Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SteamAuthenticator has_phone_number JSONDecodeError #349

Open
DarkApocalypse opened this issue Aug 3, 2021 · 2 comments
Open

SteamAuthenticator has_phone_number JSONDecodeError #349

DarkApocalypse opened this issue Aug 3, 2021 · 2 comments

Comments

@DarkApocalypse
Copy link

i got an issue with an example of code:

from steam.client import SteamClient
from steam.guard import SteamAuthenticator
import os, json

wa = SteamClient()
wa.cli_login()

sa = SteamAuthenticator(backend=wa)
sa.add()
json.dump(sa.secrets, open('./mysecrets.json', 'w'))

c = raw_input("SMS CODE")

sa.finalize(c)
sa.get_code()
wa.logout()

I have this output:

Username: [username]
Password: 
Enter email code: [code]
Traceback (most recent call last):
  File "steam-test.py", line 10, in <module>
    sa.add()    # SMS code will be send to the account's phone number
  File "[path]/.local/lib/python3.8/site-packages/steam/guard.py", line 168, in add
    if not self.has_phone_number():
  File "[path]/.local/lib/python3.8/site-packages/steam/guard.py", line 365, in has_phone_number
    resp = sess.post('https://steamcommunity.com/steamguard/phoneajax',
  File "/usr/lib/python3/dist-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@rossengeorgiev
Copy link
Contributor

Does this always happen? Or just one time?
Looks like the response was not in JSON format. Could have happened while Steam was down.

@DarkApocalypse
Copy link
Author

I tried again and i got same error. Steam is online, and it happen everytime i test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants