fut icon indicating copy to clipboard operation
fut copied to clipboard

KeyError in Core.py

Open anzhehong opened this issue 7 years ago • 6 comments

I can easily reproduce this issue if a session could not be set up due to a session which is not ended. Moreover, there are many other places in core.py where json would encounter this KeyError problem.

Traceback (most recent call last):
  File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1599, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1026, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/Users/me/Desktop/fifa/fut/tests/mytest.py", line 38, in <module>
    session = fut.Core('mail', 'pass', 'secret', platform='xbox', sms=False)
  File "/Users/me/Desktop/fifa/fut/fut/core.py", line 294, in __init__
    self.__launch__(email, passwd, secret_answer, platform=platform, code=code, totp=totp, sms=sms, emulate=emulate, proxies=proxies)
  File "/Users/me/Desktop/fifa/fut/fut/core.py", line 599, in __launch__
    if self._usermassinfo['settings']['configs'][2]['value'] == 0:
KeyError: 'settings'

anzhehong avatar Nov 20 '17 02:11 anzhehong

due to a session which is not ended.

What exactly do You mean, how can i reproduce this error on latest version?

oczkers avatar Nov 29 '17 16:11 oczkers

Sorry, I cannot remember clearly how this was reproduced, but roughly, you can start a session and handle some chores. Then, you can start another one without ending the first one. Maybe there would be some issues with the first one.

Btw, thanks so much for your library! I've developed an auto buyer script to help me buy the cheapest player I want!

anzhehong avatar Dec 02 '17 00:12 anzhehong

Then, you can start another one without ending the first one. Maybe there would be some issues with the first one.

If You do this, or simply click button on webapp opened in browser there's gonna be MultipleSession exception. My guess is that You've created another session when fut was still launching so no need to fix this.

oczkers avatar Dec 02 '17 19:12 oczkers

I get the same error here, trying to integrate kirovs anticaptcha solving. My try looks like:

session = fut.Core(...)
... doing requests until captcha...
except Captcha:
    delete session
    session = fut.Core(...)

The second call to fut.Core() raises keyerror 'settings'... Do you have a clue about that?

EDIT: starting a new session with delete and a second call to fut.Core() succeeds, if no captcha error was received in the old session...

likegliss avatar Dec 07 '17 07:12 likegliss

@likegliss Yes, session is not property deleted after catcha raised so i don't recommend not use it for now, we need little bit more work here.

oczkers avatar Dec 07 '17 20:12 oczkers

@oczkers the latest release seems to solve this issue...

likegliss avatar Dec 09 '17 16:12 likegliss