futapi / fut Goto Github PK
View Code? Open in Web Editor NEWfut is a simple library for managing Fifa 19 Ultimate Team.
License: GNU General Public License v3.0
fut is a simple library for managing Fifa 19 Ultimate Team.
License: GNU General Public License v3.0
Hello,
since last weekend issues I'm getting this error every time I try to connect, any idea of what's wrong with the library/API?
I just 'print rc' on line 172
[2014-04-29 09:50:47,295: DEBUG/Worker-3] "POST /iframe/fut/p/ut/auth HTTP/1.1" 200 98
[2014-04-29 09:50:47,297: WARNING/Worker-3] {u'debug': u'', u'reason': u'max sessions', u'code': u'503', u'string': u'Service Unavailable (ut)'}
[2014-04-29 09:50:47,297: ERROR/Worker-3] cFUT1: connecting to FUT: 'sid'
thanks
Hello and first of all, thanks for this great lib !
I'm experiencing an issue as I recently tried to put my script on a new computer : I get the error fut14.exceptions.Fut14Error: Invalid email or password.
That's really weird because I basically made a copy/paste of the script, and it's still working on my "old" computer. The exact same version (0.0.4) of the lib is installed on both computers (Macs). So I also tried on a server I own (Ubuntu) and get the exact same error code.
I also tried directly in Python console by importing fut14 and typing fut = fut14.Core('[email protected]','password','secret') and it doesn't work.
Do you have any idea ?
Thanks.
Sometimes website must be reload 3-4 times to get iniside of it. If the website doesn't work well, the login fails and the script closes, how can I do to control that excpetion so that a Traceback error doesn't appear and retry login?
Thanks.
hello,
based on your instructions:
fut.bid(item[0]['trade_id'], 600) # make a bid
fut.credits # it's updated automatically on every request
0
I still get the same credit after placing a bid... does anyone have seen this before?
Be able to know how many cards are on tradepile and in the watchlist
Hello,
on iphone, we don't have a secret answer :
File "C:\Python26\lib\site-packages\fut14-0.0.7-py2.6.egg\fut14\EAHashingAlgorithm.py", line 46, in chunkMessage
i = i + 1
UnboundLocalError: local variable 'i' referenced before assignment
a solution ?
Thanks
Hello, I cant run this project. I tried to run test_fut14.py but cant do it. thanks
{"debug":"","string":"Internal Server Error (ut)","reason":"","code":"500"}
{'string': 'Permission Denied', 'debug': '', 'reason': '', 'code': '461'}
{'debug': '', 'reason': '', 'code': '409', 'string': 'Conflict'}
Login process:
{"debug":"Answers do not match for nucleus id 0000000000","string":"Permission Denied","reason":"Answers do not match for nucleus id 0000000000","token":null,"code":"461"}
{"message":null,"reason":"Invalid Cookie","code":482}
{"debug":"","string":"Unauthorized (ut)","reason":"multiple session","code":"401"}
Send to pile:
{u'itemData': [{u'errorCode': 473, u'reason': u'Destination Full', u'pile': u'trade', u'id': 109178198766, u'success': False}]}
Hello,
Is there a way of getting actual watchlist/tradepile usage, I know we can get max size using:
fut.tradepile_size
fut.watchlist_size
but not sure how to get that value if it's not using i.e. len(fut.tradepile())
regards
To prevent biding on the same auction even we are the actual 'winner' can we move this check:
if rc['auctionInfo'][0]['bidState'] == 'highest':
to the begining of the bid() function?
suggestions/ideas?
hi I always get same answer when use fut.cardinfo
fut.cardInfo(1660944425)
{'Item': {'NationId': '45', 'Attribute1': '75', 'Attribute2': '72', 'Rating': '89', 'Attribute4': '91', 'Height': '170', 'CommonName': 'Iniesta', 'ItemType': 'PlayerM', 'Attribute5': '66', 'LeagueId': '53', 'PreferredFoot': 'Right', 'Rare': '1', 'LastName': 'Iniesta Luján', 'Attribute3': '91', 'DateOfBirth': {'Day': '11', 'Year': '1984', 'Month': '5'}, 'FirstName': 'Andrés', 'Attribute6': '55', 'ClubId': '241'}}
fut.cardInfo(1610612777)
{'Item': {'NationId': '45', 'Attribute1': '75', 'Attribute2': '72', 'Rating': '89', 'Attribute4': '91', 'Height': '170', 'CommonName': 'Iniesta', 'ItemType': 'PlayerM', 'Attribute5': '66', 'LeagueId': '53', 'PreferredFoot': 'Right', 'Rare': '1', 'LastName': 'Iniesta Luján', 'Attribute3': '91', 'DateOfBirth': {'Day': '11', 'Year': '1984', 'Month': '5'}, 'FirstName': 'Andrés', 'Attribute6': '55', 'ClubId': '241'}}
Hello!
I was thinking about adding some try: except: sections to most of the return parts because it's becoming difficult to identify if core object is still valid (because session is valid). I'll do an example:
searchAuctions
rc = self.get(self.urls['fut']['SearchAuctions'], params=params)
return [itemParse(i) for i in rc['auctionInfo']]
if session is expired, rc does not have 'auctionInfo' so it fails.
do you think we can add as suggested a simple if sentence like:
if 'auctionInfo' in rc:
return [itemParse(i) for i in rc['auctionInfo']], True
else:
return [], False
thank you!
I need to search a player by rareflag but my searchAuctions list return only items with 'rareflag': None
An idea?
Thanks,
Is this an EA error we can do nothing about, or was it likely caused by improper calling of their servers? Any Ideas?
File "build/bdist.macosx-10.9-intel/egg/fut14/core.py", line 322, in searchAuctions
rc = self.get(self.urls['fut']['SearchAuctions'], params=params)
File "build/bdist.macosx-10.9-intel/egg/fut14/core.py", line 256, in get
return self.request('GET', url, _args, *_kwargs)
File "build/bdist.macosx-10.9-intel/egg/fut14/core.py", line 240, in request
raise InternalServerError
Some time (1-3 hour) i'm get server answer {u'message': None, u'code': 401, u'reason': u'expired session'}
on call searchAuctions
. After automatically re-login (recreatin object fut14.Core
) i get Fut14Error: Invalid email or password
exception permanently. After re-run my application manually, work well 5-20 min and when expired session
and etc... It lasts about an hour.
When i get Fut14Error: Invalid email or password
server return some html+js page instead json:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
<script type="text/javascript">var NREUMQ=NREUMQ||[];NREUMQ.push(["mark","firstbyte",new Date().getTime()]);</script></head>
<body>
<script type="text/javascript" src="/iframe/fut/js/3c1d9ef.js"></script>
<script type="text/javascript">
var myGuestAppContext = GuestAppFramework.initGuestAppContext({
allowedOrigin: 'http://www.easports.com/'
});
myGuestAppContext.startHostAppLogin();
</script>
<script type="text/javascript">if(!NREUMQ.f){NREUMQ.f=function(){NREUMQ.push(["load",new Date().getTime()]);var e=document.createElement("script");e.type="text/javascript";e.src=(("http:"===document.location.protocol)?"http:":"https:")+"//"+"js-agent.newrelic.com/nr-100.js";document.body.appendChild(e);if(NREUMQ.a)NREUMQ.a();};NREUMQ.a=window.onload;window.onload=NREUMQ.f;};NREUMQ.push(["nrfj","beacon-2.newrelic.com","23cf6ffaaa","3278783","NlFWbEZYD0sEAkFaCw8bd01HTQ5VSg1aVA0Pa1JZXVUUSgA=",0,7,new Date().getTime(),"","","","",""]);</script></body>
</html>
My application search list of ~ 30 players, each up to 500 cards. Pause between players 5 sec, between repeat search list 5min.
Maybe this is server reaction on many requests?
The search function kept throwing an error and after printing out the rc value in the function like this:
rc = self.get(urls['fut']['SearchAuctions'], params=params)
print (rc)
I noticed that there is not a key auctionInfo like in the return statement, but only the following:
{'debug': '', 'reason': '', 'code': '461', 'string': 'Permission Denied'}
is this something I am doing wrong?
is there any way to send several items to the transfer target?
like using the button in the web app "Add to Transfer Target".
thanks :)
Hello,
I've noted that id and traeId are now alphanumeric so i.e. 100007008600L but because the app I've got is using numeric values (and it's still working) I have not upgraded it yet.
Have anyone experienced problems with this? so far from time to time I receive the 401 Unathorized error and I want to identify if it's due to this or not but apart of that it does work fine.
Regards
First off: Great tool! Thank you very much!
Is it possible to search for specific players?
These are the steps i follow:
Traceback (most recent call last):
File "<pyshell#11>", line 1, in
items = fut.searchAuctions('development', level = 'gold', category = 'contracts', max_price = 200, start = 150, page_size = 50)
File "fut14\core.py", line 277, in searchAuctions
return [itemParse(i) for i in rc['auctionInfo']]
KeyError: 'auctionInfo'
Questions:
1- Why does this error appear?
2- start parameter is the page where i wish to start?
Hi,
is it possible to quick buy players/items using this api?
I have a problem for sell my items. I buy, sent to trade pile but I can't to sell them. (and i don't have error in logs...)
import fut14
fut = fut14.Core('mail', 'password', 'anwser', platform='ps3', debug=True)items = fut.searchAuctions('development', level = 'gold', category = 'contract', min_buy=150, max_buy=200, item_id="", page_size = 50)
for item in items:
... trade_id = item['tradeId']
... buy_now_price = item['buyNowPrice']
... trade_state = item['tradeState']
... bid_state = item['bidState']
... starting_bid = item['startingBid']
... item_id = item['id']
... timestamp = item['timestamp']
... rating = item['rating']
... asset_id = item['assetId']
... resource_id = item['resourceId']
... item_state = item['itemState']
... rareflag = item['rareflag']
... formation = item['formation']
... injury_type = item['injuryType']
... suspension = item['suspension']
... contract = item['contract']
... playStyle = item['playStyle']
... discardValue = item['discardValue']
... itemType = item['itemType']
... owners = item['owners']
... offers = item['offers']
... current_bid = item['currentBid']
... expires = item['expires']print fut.credits
print fut.bid(trade_id, 200)
print fut.sendToTradepile(trade_id, item_id)
print fut.credits
items = fut.tradepile()
items = fut.unassigned()for item in items:
... fut.sell(item['item_id'], 250, buy_now=300, duration=3600)fut.keepalive()
hello,
One thing I've noted is that in order to make our request as similar as possible to 'real' app I amend the locale of the urls to match my location so, do yo think we should get implemented another param in login to pass locale as a optional arg?
urls.py
...
futweb': 'http://www.easports.com/iframe/fut/?locale=en_US&baseShowoffUrl=http%3A%2F%2Fwww.easports.com%2Fuk%2Ffifa%2Ffootball-club%2Fultimate-team%2Fshow-off&guest_app_uri=http%3A%2F%2Fwww.easports.com%2Fuk%2Ffifa%2Ffootball-club%2Fultimate-team',
...
When I enter into the web app I can see 100 items in the wathclist at most, but really I can have more. The way I know to get the real size is entering into my ps3 and see how many items there are.
Is it possible to know this using this project? Thanks
File "C:/Users/../fut14-master\fut14\core.py", line 244, in searchAuctions
for i in rc['auctionInfo']:
KeyError: 'auctionInfo'
rc value is: {'reason': '', 'code': '461', 'debug': '', 'string': 'Permission Denied'}
https://github.com/oczkers/fut14/blob/master/fut14/core.py#L240
Hello,
I wanna use a fonction to quick sell my cards,
you think it's possible ?
Regards,
Hi, why bid does not always work on my searchAuction result.
items = fut.searchAuctions('player', max_buy=13750, assetId='******')
for item in items:
print 'found player for %s' % item['buyNowPrice']
test = fut.bid(item['tradeId'], item['buyNowPrice'])
print test
return to my terminal:
found player for 13500
False
Hi Oczkers
Have you possiblity to implement trade request
https://utas.s2.fut.ea.com/ut/game/fifa14/trade?tradeIds=xxx
thanks
need this feature!!!
Hello,
when I try to search for card on market like your example,
items = fut.searchAuctions('development', # search items
level='gold', category='fitness', min_price=400, # optional parametrs
max_price=900, min_buy=500, max_buy=2000, # optional parametrs
start=0, page_size=60)
I get:
line 241, in searchAuctions
return [itemParse(i) for i in rc['auctionInfo']]
KeyError: 'auctionInfo'
I am logged in but cant search cards. Any clue?
Hi, i test to run your python script with the example usage script in readme but i have an error :
python main.py
Traceback (most recent call last):
File "main.py", line 38, in
fut.bid(item[0]['trade_id'], 600) # make a bid
KeyError: 0
Can you help me to debug this please?
I want buy and sell items immediately, if you have an example that will be great!!!
Thanks
Hi,
I just tried to implement this and compare with the normal behaviour and I found:
# {"itemData":[{"pile":"trade","tradeId":137123535782,"id":"105616846127"}]}
# Request URL:https://utas.s2.fut.ea.com/ut/game/fifa14/item
# Request Method:POST
# X-HTTP-Method-Override:PUT
# response: {"itemData":[{"id":105616846127,"pile":"trade","success":true}]}
So I'm not sure if function is correct, I've tried the following but 'rc' returns 200 (which is not true/real/correct cos auction is still in the watchlist)
def send_to_tradepile(self, id, trade_id):
"""Sends to tradepile."""
# TODO: accept multiple trade_ids (just extend list below (+ extend params?))
data = {'auctionInfo': [{'id': id}]}
params = {'tradeId': trade_id}
self.r.headers['X-HTTP-Method-Override'] = 'PUT' # prepare headers
rc = self.r.post(urls['fut']['Item'], params=params, data=json.dumps(data))
self.r.headers['X-HTTP-Method-Override'] = 'GET' # restore headers default
print rc
return True
suggestions?
if we return rc here:
def sendToTradepile(self, trade_id, item_id):
"""Sends to tradepile."""
# TODO: accept multiple trade_ids (just extend list below (+ extend params?))
if trade_id > 0 :
# won item
data = {"itemData": [{"tradeId": trade_id, "pile": "trade", "id": str(item_id)}]}
else:
# unassigned item
data = {"itemData": [{"pile": "trade", "id": str(item_id)}]}
rc = self.__put__(self.urls['fut']['Item'], data=json.dumps(data))
return rc
we could do things like this:
if rc['itemData'][0]['success']:
logger.info("{0} moved to Trade Pile".format(auction))
else:
logger.error("{0} NOT MOVED to Trade Pile. REASON: {1}".format(auction,rc['itemData'][0]['reason']))
Some time i get RuntimeError: maximum recursion depth exceeded
.
Traceback
...
File "/usr/local/lib/python2.7/dist-packages/fut14/core.py", line 232, in __request__
self.keepalive() # credits not avaible in response, manualy updating
File "/usr/local/lib/python2.7/dist-packages/fut14/core.py", line 376, in keepalive
self.__get__(self.urls['fut']['Credits'])
File "/usr/local/lib/python2.7/dist-packages/fut14/core.py", line 251, in __get__
return self.__request__('GET', url, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/fut14/core.py", line 232, in __request__
self.keepalive() # credits not avaible in response, manualy updating
File "/usr/local/lib/python2.7/dist-packages/fut14/core.py", line 376, in keepalive
self.__get__(self.urls['fut']['Credits'])
File "/usr/local/lib/python2.7/dist-packages/fut14/core.py", line 251, in __get__
return self.__request__('GET', url, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/fut14/core.py", line 232, in __request__
self.keepalive() # credits not avaible in response, manualy updating
File "/usr/local/lib/python2.7/dist-packages/fut14/core.py", line 376, in keepalive
self.__get__(self.urls['fut']['Credits'])
File "/usr/local/lib/python2.7/dist-packages/fut14/core.py", line 251, in __get__
return self.__request__('GET', url, *args, **kwargs)
...
First off - great job. Just neet to get some more into python...! So got this running today, simple contracts / Player filtering, relist of whole tradepile....!
I was wondering if there`s a way to differ between those different types of contracts (e.g. player, manager, rare...)
Is there an ID or something like that?
Found nothing simillar till now.
Thanks in advance!!
Cheers
Ar
Hello,
what do you think if instead of returning a simple 'true' value we modify keepalive to return actual credit?
def keepalive(self):
"""Just refresh/return credits amount to let know that we're still online."""
return self.__get__(self.urls['fut']['Credits'])
Hello,
after imported all i execute the test_fut14.py and it return
Traceback (most recent call last):
File "/fifa/try.py", line 2, in
import fut14
File "/fifa/fut14/init.py", line 29, in
from .core import Core
File "/fifa/fut14/core.py", line 20, in
from .urls import urls
File "/fifa/fut14/urls.py", line 3, in
import requests
ImportError: No module named requests
How do i do?
What will happen if call sendToTradepile
then in tradepile no space? I think I'm losing the card in this case.
Is it possible to add a function to store in club? I tried doing it by copy-pasting the sendtoTradepile function in core.py and changing the pilename to 'club' but it didn't work. Although I checked with the packet inspector while using the webapp and it is called 'club' pile
Some requests seems like unresponsive from this morning. Did it just happen to me? Or you have the same issues
Hi all! I have an increasing number of items that produce errors on actions. Currently two in the watchlist and three in the tradepile.
Has anyone experienced this, any idea how to purge these items from the lists?
Thanks!
Additional info:
It is somekind of ownership mismatch, possibly from me killing the process during a request (or so I assume).
Handling the items on the xbox doesn't work, and the webapp crashes when I try to sell them.
This is the error message the items in the tradepile produce:
Traceback (most recent call last):
File "./trade.py", line 212, in sellHelper
fut.sell(item['id'], price['startingBid'] , buy_now=price['buyNowPrice'], duration=3600)
File "build/bdist.macosx-10.9-intel/egg/fut14/core.py", line 356, in sell
rc = self.post(self.urls['fut']['SearchAuctionsListItem'], data=json.dumps(data))
File "build/bdist.macosx-10.9-intel/egg/fut14/core.py", line 260, in post
return self.request('POST', url, _args, *_kwargs)
File "build/bdist.macosx-10.9-intel/egg/fut14/core.py", line 244, in request
raise Conflict
need this function!!!
I sometimes get the following error, and I'm only using the login-part of your script to get authenticated credentials. Any idea why this happens?
File "/home/user/fut14/core.py", line 11, in <module>
import requests
import requests
File "/usr/lib/python2.7/dist-packages/requests/__init__.py", line 58, in <module>
File "/usr/lib/python2.7/dist-packages/requests/__init__.py", line 58, in <module>
import requests
File "/usr/lib/python2.7/dist-packages/requests/__init__.py", line 58, in <module>
from . import utils
File "/usr/lib/python2.7/dist-packages/requests/utils.py", line 23, in <module>
from . import utils
File "/usr/lib/python2.7/dist-packages/requests/utils.py", line 23, in <module>
from . import utils
File "/usr/lib/python2.7/dist-packages/requests/utils.py", line 23, in <module>
from .compat import parse_http_list as _parse_list_header
File "/usr/lib/python2.7/dist-packages/requests/compat.py", line 89, in <module>
from .compat import parse_http_list as _parse_list_header
File "/usr/lib/python2.7/dist-packages/requests/compat.py", line 89, in <module>
from .compat import parse_http_list as _parse_list_header
File "/usr/lib/python2.7/dist-packages/requests/compat.py", line 89, in <module>
import cookielib
File "/usr/lib/python2.7/cookielib.py", line 38, in <module>
import cookielib
File "/usr/lib/python2.7/cookielib.py", line 38, in <module>
import cookielib
File "/usr/lib/python2.7/cookielib.py", line 38, in <module>
from calendar import timegm
from calendar import timegm
File "/usr/lib/python2.7/calendar.py", line 9, in <module>
File "/usr/lib/python2.7/calendar.py", line 9, in <module>
import datetime
from calendar import timegm
File "/usr/lib/python2.7/calendar.py", line 9, in <module>
import datetime
ImportError ImportError: : import datetime
ImportError: /usr/lib/python2.7/lib-dynload/datetime.x86_64-linux-gnu.so: failed to map segment from shared object: Cannot allocate memory/usr/lib/python2.7/lib-dynload/datetime.x86_64-linux-gnu.so: failed to map segment from shared object: Cannot allocate memory/usr/lib/python2.7/lib-dynload/datetime.x86_64-linux-gnu.so: failed to map segment from shared object: Cannot allocate memory
In fut.searchAuctions(), what does the parameter 'start' do exactly?
My assumption is that it refers to the page number to look at. With page_size=50, start=10 would mean that the first 500 results would be ignored and the results shown would be 501 to 550. Is this correct?
Every time I try and sell a player from the unassigned player I get permission denied. Is there a fix?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.