Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

python_aternos.aterrors.CredentialsError: Unable to parse TOKEN from the page #15

Closed
rimgro opened this issue Apr 27, 2022 · 8 comments
Closed
Labels
bug Something isn't working update Aternos API or security methods were changed

Comments

@rimgro
Copy link

rimgro commented Apr 27, 2022

`Ignoring exception in command startserver:
Traceback (most recent call last):
File "C:\Users\rimgro\PycharmProjects\aternos-utils\venv\lib\site-packages\python_aternos\atconnect.py", line 33, 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 "C:\Users\rimgro\PycharmProjects\aternos-utils\venv\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\rimgro\PycharmProjects\aternos-utils\main.py", line 52, in startserver
await start_server()
File "C:\Users\rimgro\PycharmProjects\aternos-utils\main.py", line 24, in start_server
aternos = Client.from_credentials(config.ATERNOS_USERNAME, config.ATERNOS_PASSWORD)
File "C:\Users\rimgro\PycharmProjects\aternos-utils\venv\lib\site-packages\python_aternos_init_.py", line 47, in from_credentials
return cls.from_hashed(username, md5)
File "C:\Users\rimgro\PycharmProjects\aternos-utils\venv\lib\site-packages\python_aternos_init_.py", line 23, in from_hashed
atconn.parse_token()
File "C:\Users\rimgro\PycharmProjects\aternos-utils\venv\lib\site-packages\python_aternos\atconnect.py", line 39, in parse_token
raise CredentialsError(
python_aternos.aterrors.CredentialsError: Unable to parse TOKEN from the page`

@rimgro
Copy link
Author

rimgro commented Apr 27, 2022

The only thing I can notice is that I live in Russia where advertising does not work and because of this, anti-adblock works, but the problem remains on Heroku (US servers)

@DarkCat09
Copy link
Owner

Thanks. I know about the error.
As I said in #14, the problem is that Aternos has changed a bit the structure of the page, and the regexp can't match a <script> with token.
Please, wait a while, I'll release the fix tomorrow at about 10:30 GMT+4.

@DarkCat09 DarkCat09 added bug Something isn't working update Aternos API or security methods were changed labels Apr 27, 2022
@rimgro
Copy link
Author

rimgro commented Apr 27, 2022

Will the anti-adblock bypass be added, or is it impossible?

@DarkCat09
Copy link
Owner

DarkCat09 commented Apr 27, 2022

Disabling detecting is not needed. The module successfully parses pages because adblock is checked in JavaScript executed on client side (in browser).


And I've found what causes this error. CloudScraper often can't pass the DDoS-protection and requests returns Cloudflare's "Please Wait" title instead of the normal Aternos page.
Screenshot

@rimgro
Copy link
Author

rimgro commented Apr 27, 2022

Thanks for the help!

@JimmyTheGreat1500
Copy link

Has it been patched?

@JimmyTheGreat1500
Copy link

Doesn't seem to but idk

@adxptived
Copy link

Did you find a solution to the problem?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working update Aternos API or security methods were changed
Projects
None yet
Development

No branches or pull requests

4 participants