Giter Site home page Giter Site logo

fut's People

Contributors

arthurnn avatar dan-gamble avatar dersoerrn95 avatar evgkirov avatar farukuzun avatar flipdazed avatar hunterjm avatar innursery avatar j-stone avatar jamslater avatar jflorez29 avatar jsarasti avatar lasseregin avatar maxime-desmarchelier avatar mvillarejo avatar oczkers avatar sheh avatar syndac avatar trevormccormick avatar x1a0 avatar xaranaktu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fut's Issues

503 error 'max sessions' - Service Unavailable (ut)

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

Invalid email or password

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.

Control exception

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.

fut.bid(trade_id, bid) does not return updated credits

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?

IOS

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

List of errors

{"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}]}

how to get actual watchlist/tradepile size?

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

fut.cardInfo

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'}}

Error control

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!

Search player by rareFlag

I need to search a player by rareflag but my searchAuctions list return only items with 'rareflag': None

An idea?
Thanks,

InternalServerError

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

expired session

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?

Issue with search Auction

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?

add to watchlist

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 :)

auctions with id and tradeId: <<number>>L

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

KeyError: 'auctionInfo' ??

These are the steps i follow:

  • import fut14
  • fut = fut14.Core('[email protected]', 'passwd', 'answer', platform = 'ps3', debug = True)
  • fut.credits
    (number of credits well returned)
  • items = fut.searchAuctions('development', level = 'gold', category = 'contracts', max_price = 200, start = 150, page_size = 50)

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?

Buying

Hi,
is it possible to quick buy players/items using this api?

Probleme with sell

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()

locale usage

Get real watchlist size

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

Quick sell

Hello,

I wanna use a fonction to quick sell my cards,

you think it's possible ?

Regards,

DiCoco

Why bid does not always work

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

Search auction not working?

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?

bid error

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

send_to_tradepile not working?

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?

sendToTradepile improvements

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']))

keepalive recursion

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)
...

Is it possible to filter contracts by manager or player?

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

keepalive() return actual credit?

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'])

ImportError: No module named requests

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?

Store in club

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

Unactionable items

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

failed to map segment from shared object: Cannot allocate memory

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

What does the START parameter do exactly?

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?

Permission Denied

Every time I try and sell a player from the unassigned player I get permission denied. Is there a fix?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.