futapi / fut

fut is a simple library for managing Fifa 19 Ultimate Team.
GNU General Public License v3.0
316 stars 138 forks source link

New login verification system #116

Open oczkers opened 9 years ago

oczkers commented 9 years ago

The reason of creating new issue is to collect all info about new verification system (code, secreat answer, captcha etc.) in one place.

  1. Secret answer is no used anymore since we got code validation?
  2. Captcha pops out in login process or just when you are logged in and make to fast requests?

PS. I've pushed new commit (33f7192f55fc89820fe301cf8dcbf2e3490210fd) that enables two step verification (email/sms code), it's not yet tested and probably doesn't work ;-).

TODO:

Noxdzine commented 9 years ago

hey mates! Just a question: Where do you host your app? because I host my own to heroku and their servers restarts every 24 hours (free plan), so I have to change the code every time...

peilien commented 9 years ago

I run from linux server at home. You might want to consider using EC2 free tier. However I don't know if EA blacklists EC2 IPs.

Noxdzine commented 9 years ago

thank you for the tip ;) I'll check it

peilien commented 9 years ago

@ricklhp7

I just tried your procedure from 5 days ago and it works like a charm. Thanks. I'll see how long the cookie lasts. Sounds like you're running multiple bots behind the same IP. I wonder if EA is expiring your session more aggressively than others. I'll find out when my login fails again.

How do you manage to transfer money between your accounts?

peilien commented 9 years ago

@oczkers

This is just FYI. I'm using Python 2.4.x and I've had to hack a few things to get the script to work. I don't really know what I'm doing as I'm not that good with Python so feel free to throw these away or correct what I did. Thank you for the awesome tool.

@@ -90,7 +91,7 @@
 def cardInfo(resource_id):
     """Returns card info."""
     # TODO: add referer to headers (futweb)
-    url = '{}{}.json'.format(self.urls['card_info'], baseId(resource_id))
+    url = '{0}{1}.json'.format(self.urls['card_info'], baseId(resource_id))
     return requests.get(url).json()
 '''

@@ -153,7 +154,7 @@
         else:
             raise FutError('Invalid emulate parameter. (Valid ones are and/ios).')  # pc/ps3/xbox/
         # === login
-        self.urls['login'] = self.r.get(self.urls['fut_home']).url
+        self.urls['login'] = self.r.get(self.urls['fut_home'],verify=False).url
         self.r.headers['Referer'] = self.urls['login']  # prepare headers
         data = {'email': email,
                 'password': passwd,
@@ -393,7 +394,7 @@
     def cardInfo(self, resource_id):
         """Returns card info."""
         # TODO: add referer to headers (futweb)
-        url = '{}{}.json'.format(self.urls['card_info'], baseId(resource_id))
+        url = '{0}{1}.json'.format(self.urls['card_info'], baseId(resource_id))
         return requests.get(url).json()

     def searchDefinition(self, asset_id, start=0, count=35):
@@ -515,7 +516,7 @@

     def tradepileDelete(self, trade_id):
         """Removes card from tradepile."""
-        url = '{}/{}'.format(self.urls['fut']['TradeInfo'], trade_id)
+        url = '{0}/{1}'.format(self.urls['fut']['TradeInfo'], trade_id)
         self.__delete__(url)  # returns nothing
         return True

dinana commented 9 years ago

I keep receiving a huge HTML which overflows my cmd screen (the one with the iframe like the webapp) then I get this: Arguments: () Traceback (most recent call last): File "", line 1, in File "*\fut\fut\core.py", line 106, in init**

self.__login__(email, passwd, secret_answer, platform, code, emulate)

File "***\fut\fut\core.py", line 274, in _login _ raise UnknownError fut.exceptions.UnknownError

Any idea?

(N.B. I'm using this: >>> fut = fut.Core('email','password','secret',platform='ps3', code = 'codeFromEmail', emulate='and',cookies='cookies2.txt')) (N.B.2. Also worth mentioning that cookies2.txt never gets created, should be in the same folder, right?) (N.B.3. I receive another email with the same code afterwards)

dinana commented 9 years ago

This is the issue I'm facing :/ image Solved now :)

oczkers commented 9 years ago

@peilien Thanks for feedback, string format fixed c4444c0f0b5f71874ceef25165b80c979369b264 I supose cert verification it's not working corectly on python 2.4 but i won't changed it just to keep compatibility. Curious why don't you update to newer version?

peilien commented 9 years ago

@oczkers

Oh I just have this old centos box that I haven't upgraded. You're right I should probably upgrade!

vmuruganandam commented 9 years ago

I think I'm having an issue relating to the new login verification system as well. I keep getting this error every time I input the security code given to me by origin. This is the code I'm using:

import fut fut = fut.Core('xxx@gmail.com', 'pass', 'secret', platform='ps3', debug=True, code='3333')

But I keep getting this error: File "build/bdist.macosx-10.9-intel/egg/fut/core.py", line 106, in init File "build/bdist.macosx-10.9-intel/egg/fut/core.py", line 294, in login File "build/bdist.macosx-10.9-intel/egg/fut/core.py", line 556, in pileSize File "build/bdist.macosx-10.9-intel/egg/fut/core.py", line 347, in get File "build/bdist.macosx-10.9-intel/egg/fut/core.py", line 330, in request fut.exceptions.Captcha

Here is my log file as well: https://gist.github.com/vmuruganandam/8da12ad4b8cb60f4f1a5

Is it just because its not recognizing the code I'm giving?

oczkers commented 9 years ago

Looks like your session is validated and code is not required but captcha appeared and you have to resolve it manualy or maybe remove cookies.txt and restart to create new session.

"Your FUT account has been temporarily disabled because too many actions have been taken. Please solve the question below to unlock your account."

vmuruganandam commented 9 years ago

Ohh, I didn't even realize. I went in and manually fixed that. I get a different error now, not really sure what this one means either. Went through the source code and couldn't really find an answer.

File "build/bdist.macosx-10.9-intel/egg/fut/core.py", line 106, in init File "build/bdist.macosx-10.9-intel/egg/fut/core.py", line 199, in login AttributeError: 'NoneType' object has no attribute 'group'

Log: https://gist.github.com/vmuruganandam/8da12ad4b8cb60f4f1a5

vmuruganandam commented 9 years ago

Huh....I don't know why this is a problem but all the parameters that I passed to fut.Core had double quotes and after I changed them to single quotes, the error didn't show up anymore. I'm not even sure that this is the actual problem and maybe I just had to wait before trying to log in again but that seemed to fix it. By the way, does turning off this two factor authentication system manually in your origin settings allow one to login without using codes at all? Right now I'm resorting to using the backup codes because of how buggy these security codes seem to be (sometimes they don't seem to work, some I don't receive in my email, etc).

oczkers commented 9 years ago

You got 500 error and empty response - looks like a temporary server error, retryng after few seconds/minutes should help.

Double or single quote doesn't make any diference, it was probably just temporary sever error :-)

worldowner commented 9 years ago

Traceback (most recent call last): File "./buyer", line 5, in fut = fut.Core(login, pass, sec_pass, code=origin_code, platform='ps3') File "/usr/local/lib/python2.7/dist-packages/fut/core.py", line 107, in init self.login(email, passwd, secret_answer, platform, code, emulate) File "/usr/local/lib/python2.7/dist-packages/fut/core.py", line 188, in login if self.r.get(self.urls['main_site']+'/fifa/api/isUserLoggedIn').json()['isLoggedIn'] is not True: # TODO: parse error? TypeError: 'dict' object is not callable

Is it a bug or I'm doing something wrong?

worldowner commented 9 years ago

It works on Debian 8, but not on Debian 7.

oczkers commented 9 years ago

My guess would be old requests - updating or chaning json() to json should help

KmanProdz commented 8 years ago

@LUFCMOT are you using the guzzle php framework? I figured it out if you still haven't done it. You need to geteffectiveUrl() from the response of the login part and post data to that

Rayen-benslimen commented 3 years ago

Hi , how may i post my Email and Password ( True login page )