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

[Question] Does websocket method need to re-login? #72

Closed scmanjarrez closed 1 year ago

scmanjarrez commented 1 year ago

Hi, thanks for your work!

After experimenting a bit with the library, I've noticed that sometimes you need to log in again in order to generate a new token (.fetch() fails with `equests.exceptions.HTTPError: 418 Client Error: I'm a teapot for url). Does websocket also require to login again, or is the connection always alive? Is it possible to generate a new token without calling log in (with or without websocket)?

DarkCat09 commented 1 year ago

@scmanjarrez,

You just need to call AternosClient.atconn.parse_token() method to renew the token.

I don't know for how much time the Aternos token is valid, but this can be checked by periodically requesting any page, e.g. https://aternos.org/go, and comparing parsed AJAX_TOKENs.

scmanjarrez commented 1 year ago

Thank you!