Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
oczkers committed Nov 12, 2017
2 parents 92dc8f2 + a9611e2 commit 8fd774b
Show file tree
Hide file tree
Showing 9 changed files with 288 additions and 152 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fut.egg-info/
.coverage
coverage.xml
cookies.txt
token.txt
test.py
test_old.py
testemu.py
Expand All @@ -18,3 +19,4 @@ test.log
testemu.py
screenlog.0
codecov.yml
club_players.txt
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ Changelog
---------


0.3.6 (2017-11-12)
^^^^^^^^^^^^^^^^^^

* add sbsSetChallenges (thanks to dan-gamble #330)
* readme polish (thanks to syndac)
* add tradepileClear
* add sbsSquad
* add sendToSbs
* add clubConsumables
* correct version param in pinevents
* save token between logins (maybe cookies are not needed?)

0.3.5 (2017-10-26)
^^^^^^^^^^^^^^^^^^

Expand Down
81 changes: 52 additions & 29 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ Consumables database provided by koolaidjones: https://github.com/koolaidjones/F
`Click here to get Slack invitation <https://gentle-everglades-93932.herokuapp.com>`_


PHP ported version by InkedCurtis
---------------------------------

If You prefer php language, there is ported version made by InkedCurtis: https://github.com/InkedCurtis/FUT-API


AutoBuyer GUI
-------------

Expand All @@ -76,7 +82,9 @@ Optional parameters:
.. code-block:: python
>>> import fut
>>> fut = fut.Core('email', 'password', 'secret answer')
>>> session = fut.Core('email', 'password', 'secret answer')
Be sure to set :code:`platform=` to your platform and :code:`sms=True` if you use SMS for 2 Factor Authentication.

Search
------
Expand All @@ -103,7 +111,7 @@ Optional parameters:

.. code-block:: python
>>> items = fut.searchAuctions('development')
>>> items = session.searchAuctions('development')
Bid
---
Expand All @@ -114,7 +122,7 @@ Optional parameters:

.. code-block:: python
>>> fut.bid(items[0]['trade_id'], 600)
>>> session.bid(items[0]['trade_id'], 600)
Sell
----
Expand All @@ -126,7 +134,8 @@ Optional parameters:

.. code-block:: python
>>> fut.sell(item['item_id'], 150)
>>> session.sell(item['item_id'], 150)
Before selling a newly-bought item, you have to send it to the tradpile. :code:`session.sendToTradepile(item_id)`

Quick sell
----------
Expand All @@ -136,39 +145,39 @@ single item:
.. code-block:: python
>>> item_id = 123456789
>>> fut.quickSell(item_id)
>>> session.quickSell(item_id)
multiple items:

.. code-block:: python
>>> item_id = [123456789, 987654321]
>>> fut.quickSell(item_id)
>>> session.quickSell(item_id)
Piles (Watchlist / Tradepile / Unassigned / Squad / Club)
---------------------------------------------------------


.. code-block:: python
>>> items = fut.tradepile()
>>> items = fut.unassigned()
>>> items = fut.squad()
>>> items = fut.club(count=10, level=10, type=1, start=0)
>>> items = fut.clubConsumablesDetails()
>>> fut.sendToTradepile(trade_id, item_id) # add card to tradepile
>>> fut.sendToClub(trade_id, item_id) # add card to club
>>> fut.sendToWatchlist(trade_id) # add card to watchlist
>>> fut.tradepileDelete(trade_id) # removes item from tradepile
>>> fut.watchlistDelete(trade_id) # removes item from watch list (you can pass single str/ing or list/tuple of ids - like in quickSell)
>>> fut.tradepile_size # tradepile size (slots)
>>> items = session.tradepile()
>>> items = session.unassigned()
>>> items = session.squad()
>>> items = session.club(count=10, level=10, type=1, start=0)
>>> items = session.clubConsumablesDetails()
>>> session.sendToTradepile(item_id) # add card to tradepile
>>> session.sendToClub(trade_id, item_id) # add card to club
>>> session.sendToWatchlist(trade_id) # add card to watchlist
>>> session.tradepileDelete(trade_id) # removes item from tradepile
>>> session.watchlistDelete(trade_id) # removes item from watch list (you can pass single str/ing or list/tuple of ids - like in quickSell)
>>> session.tradepile_size # tradepile size (slots)
80
>> len(fut.tradepile()) # tradepile fulfilment (number of cards in tradepile)
>> len(session.tradepile()) # tradepile fulfilment (number of cards in tradepile)
20
>>> fut.watchlist_size # watchlist size (slots)
>>> session.watchlist_size # watchlist size (slots)
30
>> len(fut.watchlist()) # watchlist fulfilment (number of cards in watchlist)
>> len(session.watchlist()) # watchlist fulfilment (number of cards in watchlist)
10
Credits
Expand All @@ -178,7 +187,7 @@ It's cached on every request so if you want the most accurate info call fut.kepp

.. code-block:: python
>>> fut.credits
>>> session.credits
600
Relist
Expand All @@ -188,7 +197,7 @@ Relists all expired cards in tradepile.

.. code-block:: python
>>> fut.relist() # relist all expired cards in tradepile
>>> session.relist() # relist all expired cards in tradepile
Apply consumable
----------------
Expand All @@ -200,7 +209,7 @@ Apply consumable on player.

.. code-block:: python
>>> fut.applyConsumable(item_id, resource_id)
>>> session.applyConsumable(item_id, resource_id)
Card stats and definiction IDs
------------------------------
Expand All @@ -209,7 +218,7 @@ Returns stats and definition IDs for each card variation.

.. code-block:: python
>>> fut.searchDefinition(asset_id, start=0, count=35)
>>> session.searchDefinition(asset_id, start=0, count=35)
Keepalive
---------
Expand All @@ -218,7 +227,7 @@ Sends keepalive ping and returns current credits amount (you have to make at lea

.. code-block:: python
>>> fut.keepalive()
>>> session.keepalive()
650
Logout
Expand All @@ -228,7 +237,7 @@ Logs out nicely (like clicking on logout button).

.. code-block:: python
>>> fut.logout()
>>> session.logout()
Database
Expand Down Expand Up @@ -315,20 +324,34 @@ to be continued ;-)
Problems
--------

Getting "requests.exceptions.SSLError:....'utas.mob.v4.fut.ea.com' doesn't match 'utas.mobapp.fut.ea.com'"?
^^^^
This is a new error, but here's a temporary fix to try:

1. Re-download the api from github
2. Go into fut/urls.py
3. On line 7, change :code:`auth_url = rc['authURL']` to :code:`auth_url = 'utas.mobapp.fut.ea.com'`
4. Run `python setup.py install`
5. Try your script again
6. **Please report in the Slack channel whether or not this worked!!**


Bans
^^^^

To avoid getting ban take a look at our little discussion/guide thread:
https://github.com/oczkers/fut/issues/259

Generally speaking, you should send no more than 500 requests per hour and 5000 requests per day. Be somewhat human. If you encounter a captcha, try to answer/solve it as soon as possible.

Somehow i've sent card to full tradepile and it disappeared
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Make space in tradepile and just call one command to restore it:

.. code-block:: python
fut.sendToTradepile(-1, id)
session.sendToTradepile(-1, id)
I've got card with None tradeId so cannot move/trade it
Expand All @@ -338,7 +361,7 @@ Make space in tradepile and just call one command to restore it:

.. code-block:: python
fut.sendToTradepile(-1, id)
session.sendToTradepile(-1, id)
PermissionDenied exceptions raises when trying to sell cards directly from watchlist
Expand Down
10 changes: 5 additions & 5 deletions fut/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
Basic usage:
>>> import fut
>>> fifa = fut.Core('email', 'password', 'secret_answer')
>>> items = fut.searchAuctions('development')
>>> fut.bid(items[0]['trade_id'], 600)
>>> session = fut.Core('email', 'password', 'secret_answer')
>>> items = session.searchAuctions('development')
>>> session.bid(items[0]['trade_id'], 600)
True
>>> fut.sell(item['item_id'], 150)
>>> session.sell(item['item_id'], 150)
1123321
Expand All @@ -23,7 +23,7 @@
"""

__title__ = 'fut'
__version__ = '0.3.5'
__version__ = '0.3.6'
__author__ = 'Piotr Staroszczyk'
__author_email__ = 'piotr.staroszczyk@get24.org'
__license__ = 'GNU GPL v3'
Expand Down
1 change: 1 addition & 0 deletions fut/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@


cookies_file = 'cookies.txt'
token_file = 'token.txt'
timeout = 15 # defaulf global timeout
delay = (1, 3) # default mininum delay between requests (random range)
Loading

0 comments on commit 8fd774b

Please sign in to comment.