Merge branch 'main' of https://github.com/DarkCat09/python-aternos
This commit is contained in:
commit
2907c5a0c1
3 changed files with 15 additions and 13 deletions
25
README.md
25
README.md
|
@ -22,6 +22,18 @@
|
||||||
An unofficial Aternos API written in Python.
|
An unofficial Aternos API written in Python.
|
||||||
It uses [aternos](https://aternos.org/)' private API and html parsing.
|
It uses [aternos](https://aternos.org/)' private API and html parsing.
|
||||||
|
|
||||||
|
> **WARNING**
|
||||||
|
>
|
||||||
|
> Recently, Aternos started somehow detecting
|
||||||
|
> API requests from this library.
|
||||||
|
> Any automated access is prohibited according
|
||||||
|
> to [Terms of Service §5.2e](https://aternos.gmbh/en/aternos/terms#:~:text=Automatically%20accessing%20our%20website%20or%20automating%20actions%20on%20our%20website.),
|
||||||
|
> and results in **permanent ban**.
|
||||||
|
>
|
||||||
|
> **USE AT YOUR OWN RISK**
|
||||||
|
>
|
||||||
|
> I will try to fix that as soon as possible.
|
||||||
|
|
||||||
Python Aternos supports:
|
Python Aternos supports:
|
||||||
|
|
||||||
- Logging in to account with password (plain or hashed) or `ATERNOS_SESSION` cookie value
|
- Logging in to account with password (plain or hashed) or `ATERNOS_SESSION` cookie value
|
||||||
|
@ -34,19 +46,6 @@ Python Aternos supports:
|
||||||
- Changing server subdomain and MOTD (message-of-the-day)
|
- Changing server subdomain and MOTD (message-of-the-day)
|
||||||
- Managing files, settings, players (whitelist, operators, etc.)
|
- Managing files, settings, players (whitelist, operators, etc.)
|
||||||
|
|
||||||
> **Warning**
|
|
||||||
>
|
|
||||||
> According to the Aternos' [Terms of Service §5.2e](https://aternos.gmbh/en/aternos/terms#:~:text=Automatically%20accessing%20our%20website%20or%20automating%20actions%20on%20our%20website.),
|
|
||||||
> you must not use any software or APIs for automated access,
|
|
||||||
> beacuse they don't receive money from advertisting in this case.
|
|
||||||
>
|
|
||||||
> I always try to hide automated python-aternos requests
|
|
||||||
> using browser-specific headers/cookies,
|
|
||||||
> but you should make backups to restore your world
|
|
||||||
> if Aternos detects violation of ToS and bans your account
|
|
||||||
> (view issues [#16](https://github.com/DarkCat09/python-aternos/issues/16)
|
|
||||||
> and [#46](https://github.com/DarkCat09/python-aternos/issues/46)).
|
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
### Common
|
### Common
|
||||||
|
|
|
@ -125,6 +125,8 @@ class Client:
|
||||||
session (str): Session cookie value
|
session (str): Session cookie value
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
self.atconn.parse_token()
|
||||||
|
self.atconn.generate_sec()
|
||||||
self.atconn.session.cookies['ATERNOS_SESSION'] = session
|
self.atconn.session.cookies['ATERNOS_SESSION'] = session
|
||||||
|
|
||||||
def logout(self) -> None:
|
def logout(self) -> None:
|
||||||
|
|
|
@ -139,6 +139,7 @@ class Js2PyInterpreter(Interpreter):
|
||||||
ctx.execute('window.Map = function(_i){ };')
|
ctx.execute('window.Map = function(_i){ };')
|
||||||
ctx.execute('window.setTimeout = function(_f,_t){ };')
|
ctx.execute('window.setTimeout = function(_f,_t){ };')
|
||||||
ctx.execute('window.setInterval = function(_f,_t){ };')
|
ctx.execute('window.setInterval = function(_f,_t){ };')
|
||||||
|
ctx.execute('document.getElementById = function(_a) { };')
|
||||||
ctx.execute('window.encodeURIComponent = function(_s){ };')
|
ctx.execute('window.encodeURIComponent = function(_s){ };')
|
||||||
|
|
||||||
self.ctx = ctx
|
self.ctx = ctx
|
||||||
|
|
Reference in a new issue