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

Code hang in using session #81

Closed Supslike closed 1 year ago

Supslike commented 1 year ago

when I use username and password for logging in, starting the server works absolutely fine

aternos = Client()
aternos.login(username = os.environ["username"]), password = os.environ["password"])
aternos_account = aternos.account
server = aternos_account.list_servers()[0]
server.start()

But when I use session for logging in, it gets stuck on server.start()

aternos = Client()
aternos.login_with_session(session=os.environ["session"])
aternos_account = aternos.account
server = aternos_account.list_servers()[0]
server.start()

it doesn't only affect start but also stop, and restart

DarkCat09 commented 1 year ago

Try to add these lines after login_with_session:

aternos.parse_token()
aternos.generate_sec()

That was fixed in the last commit, but not released.

Supslike commented 1 year ago

I get this now

AttributeError: 'Client' object has no attribute 'parse_token'

already reinstalled python-aternos

DarkCat09 commented 1 year ago

@Supslike, I'm sorry, I meant this code:

aternos.atconn.parse_token()
aternos.atconn.generate_sec()