DarkCat09 / python-aternos

[UNMAINTAINED] Unofficial Aternos API written in Python
https://pypi.org/project/python-aternos/
Apache License 2.0
92 stars 13 forks source link

Unable to parse TOKEN from the page (Replit) #58

Closed Hugo5898 closed 1 year ago

Hugo5898 commented 1 year ago

Traceback (most recent call last): File "/home/runner/DiscordBot/venv/lib/python3.8/site-packages/python_aternos/atconnect.py", line 44, in parse_token token_func = js_code[1] if len(js_code) > 1 else js_code[0] IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "main.py", line 13, in aternos = Client.from_credentials(user, pswd) File "/home/runner/DiscordBot/venv/lib/python3.8/site-packages/python_aternos/init.py", line 47, in from_credentials return cls.from_hashed(username, md5) File "/home/runner/DiscordBot/venv/lib/python3.8/site-packages/python_aternos/init.py", line 23, in from_hashed atconn.parse_token() File "/home/runner/DiscordBot/venv/lib/python3.8/site-packages/python_aternos/atconnect.py", line 50, in parse_token raise CredentialsError( python_aternos.aterrors.CredentialsError: Unable to parse TOKEN from the page

pls help

DarkCat09 commented 1 year ago

Do you still have this problem?

DarkCat09 commented 1 year ago

On my PC, token is parsed successfully.
On Replit, python-aternos doesn't save session cookies.

Hugo5898 commented 1 year ago

Do you still have this problem?

Yes, but it only appears sometimes

DarkCat09 commented 1 year ago

You have a very old version installed.
Why don't you update it?

Also, I've just added some logging code for debugging this issue.

pip install -U "python-aternos>=2.1.3"
DarkCat09 commented 1 year ago

@Hugo5898, I can help only if you update python-aternos and send the logs.

Also, please, write these lines at the beginning of .py file, above all the code:

import logging
logging.basicConfig(level=logging.DEBUG)