From 3c972c83f0a0c9e801f82af25f7f36f65ba8abb7 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 26 Jul 2022 10:07:12 +0400 Subject: [PATCH] Bugfixes in Client, Cloudflare page example --- cloudflare.html | 225 +++++++++++++++++++++++++++++++++++++ python_aternos/atclient.py | 19 +++- 2 files changed, 241 insertions(+), 3 deletions(-) create mode 100644 cloudflare.html diff --git a/cloudflare.html b/cloudflare.html new file mode 100644 index 0000000..207a8f3 --- /dev/null +++ b/cloudflare.html @@ -0,0 +1,225 @@ + + + + + + + +Please Wait... | Cloudflare + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +

Please wait...

+

We are checking your browser... aternos.org

+ +
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+

Please stand by, while we are checking your browser...

+ +
+ + + + + + +
+
+ + + +
+
+ +
+
+ + + +
+
+
+
+
+ +
+
+
+

Why do I have to complete a CAPTCHA?

+ +

Completing the CAPTCHA proves you are a human and gives you temporary access to the web property.

+
+ +
+

What can I do to prevent this in the future?

+ + +

If you are on a personal connection, like at home, you can run an anti-virus scan on your device to make sure it is not infected with malware.

+ +

If you are at an office or shared network, you can ask the network administrator to run a scan across the network looking for misconfigured or infected devices.

+ + + +
+
+
+ + + + + +
+
+ + + + + + diff --git a/python_aternos/atclient.py b/python_aternos/atclient.py index fa5cb8f..91f041c 100644 --- a/python_aternos/atclient.py +++ b/python_aternos/atclient.py @@ -193,7 +193,11 @@ class Client: serverstree = lxml.html.fromstring(serverspage.content) servers = serverstree.xpath( +<<<<<<< HEAD '/html/body/div[1]/main/div[3]/section/div[1]/div[2]/div' +======= + '//div[@class="servers"]/div' +>>>>>>> f731f1b (Bugfixes in Client, Cloudflare page example) '/div[@class="server-body"]/@data-id' ) self.refresh_servers(servers) @@ -231,6 +235,15 @@ class Client: """ return AternosServer(servid, self.atconn) + + def logout(self) -> None: + + """Logouts from Aternos account""" + + self.atconn.request_cloudflare( + 'https://aternos.org/panel/ajax/account/logout.php', + 'GET', sendtoken=True + ) def change_username(self, value: str) -> None: @@ -242,7 +255,7 @@ class Client: self.atconn.request_cloudflare( 'https://aternos.org/panel/ajax/account/username.php', - 'POST', data={'username': value} + 'POST', data={'username': value}, sendtoken=True ) def change_email(self, value: str) -> None: @@ -263,7 +276,7 @@ class Client: self.atconn.request_cloudflare( 'https://aternos.org/panel/ajax/account/email.php', - 'POST', data={'email': value} + 'POST', data={'email': value}, sendtoken=True ) def change_password(self, old: str, new: str) -> None: @@ -283,5 +296,5 @@ class Client: 'POST', data={ 'oldpassword': old, 'newpassword': new - } + }, sendtoken=True )