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

'Client' object has no attribute 'list_servers' #77

Closed noobisbro closed 1 year ago

noobisbro commented 1 year ago

I tried to run the example code, but got this issue. Here's the code:


from python_aternos import Client

aternos = Client() aternos.login_with_session('here is a real cookie value, no isues here')

servs = aternos.list_servers() // issue

myserv = servs[0]

myserv.stop()


Python version 3.9

DarkCat09 commented 1 year ago

Thank you, I've just updated the example.
You have to request servers this way:

from python_aternos import Client

atclient = Client()
atclient.login('user', 'password')
# or atclient.login_with_session

acc = atclient.account
servs = acc.list_servers()

myserv = servs[0]