From 1e4fdd2e899ffd6a949db4e7b6db9bbe8a409a08 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 24 May 2023 18:09:37 +0400 Subject: [PATCH] lastStatus object parsing from the server page --- python_aternos/atserver.py | 31 +++++++++++++++++++++++-------- tests/test_login.py | 6 +++--- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/python_aternos/atserver.py b/python_aternos/atserver.py index b0f924b..a194ccc 100644 --- a/python_aternos/atserver.py +++ b/python_aternos/atserver.py @@ -1,14 +1,16 @@ """Aternos Minecraft server""" -import enum +import re import json +import enum + from typing import Optional from typing import List, Dict, Any import requests -from .atconnect import AJAX_URL +from .atconnect import BASE_URL, AJAX_URL from .atconnect import AternosConnect from .atwss import AternosWss @@ -18,9 +20,15 @@ from .atplayers import Lists from .atfm import FileManager from .atconf import AternosConfig +from .aterrors import AternosError from .aterrors import ServerStartError +status_re = re.compile( + r'