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

Aternos responding `This username doesn't exist` #97

Closed JasonBenfrin closed 10 months ago

JasonBenfrin commented 11 months ago

I was getting Check your username and password when I am logging in so I decided to set logger to debugger mode. It seems like Aternos is somehow not getting the data. It is responding with "error":"This username doesn't exist!". Here is my code:

import python_aternos as aternos
import os
import dotenv
import logging

dotenv.load_dotenv(override=True)
username = os.environ["USERNAME"]
password = os.environ["PASSWORD"]

print([username, password])

# Logger to debug mode
log = logging.getLogger('aternos')
handler = logging.StreamHandler()
log.setLevel(logging.DEBUG)
handler.setLevel(logging.DEBUG)

client = aternos.Client()
client.login(username, password)

account = client.account
servers = account.list_servers()

print(servers)

I've made sure that my environment variables are working.

Here is what is logged in the console:

2023-10-08 22:46:03,574 DEBUG Restoring session from C:\Users\Bhone/.at_JazTes
2023-10-08 22:46:03,864 DEBUG Requesting(GET)https://aternos.org/go/
2023-10-08 22:46:03,864 DEBUG headers={}
2023-10-08 22:46:03,864 DEBUG params={}
2023-10-08 22:46:03,865 DEBUG data={}
2023-10-08 22:46:03,865 DEBUG req-cookies={'ATERNOS_SESSION': ''}
2023-10-08 22:46:03,866 DEBUG session-cookies={}
2023-10-08 22:46:04,254 DEBUG AternosConnect received: <!DOCTYPE html>
<html lang="en">
    <head>
        <base href="/
2023-10-08 22:46:04,255 INFO  GET completed with 200 status
2023-10-08 22:46:04,307 DEBUG Requesting(POST)https://aternos.org/ajax/account/login
2023-10-08 22:46:04,307 DEBUG headers={'X-Requested-With': 'XMLHttpRequest'}
2023-10-08 22:46:04,308 DEBUG params={'TOKEN': '820mK6ydNG519nDPJyT1', 'SEC': 't71l8w04dej00000:tb6npxw8qet00000'}
2023-10-08 22:46:04,308 DEBUG data={'user': 'JazTes', 'password': '<REDACTED>'}
2023-10-08 22:46:04,309 DEBUG req-cookies={'ATERNOS_SESSION': ''}
2023-10-08 22:46:04,310 DEBUG session-cookies={'ATERNOS_LANGUAGE': 'en', 'ATERNOS_SEC_t71l8w04dej00000': 'tb6'}
2023-10-08 22:46:04,617 DEBUG AternosConnect received: {"success":false,"error":"This username doesn't exist!","data":{"
2023-10-08 22:46:04,618 INFO  POST completed with 200 status
Traceback (most recent call last):
  File "d:\Bhone\Projects\Discord\Python-Aternos\main.py", line 18, in <module>
    client.login("JazTes", "<REDACTED>")
  File "D:\Bhone\Projects\Discord\Python-Aternos\.venv\Lib\site-packages\python_aternos\atclient.py", line 53, in login
    self.login_hashed(
  File "D:\Bhone\Projects\Discord\Python-Aternos\.venv\Lib\site-packages\python_aternos\atclient.py", line 111, in login_hashed
    raise CredentialsError(
python_aternos.aterrors.CredentialsError: Check your username and password

And yes, the username is correct, as well as the password. Here is proof of the account: image

GDemay commented 10 months ago

I know how to fix it. How can I create a pull request? I need to be a collaborator?

JasonBenfrin commented 10 months ago

You need to fork this repo and then after your changes, go to Pull Requests and click New Pull Request and then click compare across forks and then click Create Pull Request

GDemay commented 10 months ago

Thanks @Teslaowls is going to do it ;)