DarkCat09 / python-aternos

[UNMAINTAINED] Unofficial Aternos API written in Python
https://pypi.org/project/python-aternos/
Apache License 2.0
92 stars 12 forks source link

python_aternos can`t parse TOKEN #17

Closed ZeynX92 closed 2 years ago

ZeynX92 commented 2 years ago

Hello everyone! I have a problem, my code was broken yesterday. I have written code that got server and then users can start()/stop() server by using discord bot, but now I have an errors:

WARNING:retry.api:Check your username and password, retrying in 0 seconds...
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...

But my password and username is valid! I don`t know what to do with this... Can you help me, please?

import config  # Importing file with password and username
from python_aternos import Client  # Iporting Client
from python_aternos.aterrors import ServerError 
from retry import retry  # Importing retry.api, because sometimes aternos has a problems with connecting
#Discord API 
from disnake.ext import commands 
from disnake import Embed

# Creating function that will get server using credentials
@retry()
def get_server():
    atern = Client.from_credentials(f'{config.username}', f'{config.password}')
    return atern.list_servers()[0]

class AternosCog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

    @commands.slash_command(
        name='start_server',
        description='Starting server',
        options=[]
    )
    async def start_server(self, ctx):
        print(get_server())  # Debug, here is the problem
        try:
            get_server().start()  # Main, here is the problem too
            await ctx.send(
                embed=Embed(title='🍏 Success!', description='Server is starting, please, wait...'))
        except ServerError:  # Exception
            await ctx.send(
                embed=Embed(title='🍏 Fail!', description='Server has already started...'))

    @commands.has_permissions(administrator=True)
    @commands.slash_command(
        name='stop_server',
        description='Stopping server',
        options=[]
    )
    async def stop_server(self, ctx):
        get_server.stop()
        await ctx.send(
            embed=Embed(title='🍏 Success!', description='Server shutting down...'))

def setup(bot):
    bot.add_cog(AternosCog(bot))

Thanks in advance, I will appreciate any help : )

DarkCat09 commented 2 years ago

Hello. Please, try to login with my test user: Client.from_credentials('world35g', 'world35g')

DarkCat09 commented 2 years ago

It'll help me to understand your problem.

ZeynX92 commented 2 years ago

Ready, same problem

WARNING:retry.api:Check your username and password, retrying in 0 seconds...
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DarkCat09 commented 2 years ago

Okay, thank you. Could you set the logging level to DEBUG to see the python-aternos request logs?

DarkCat09 commented 2 years ago
# the beginning of the file
import logging
logging.basicConfig(level=logging.DEBUG)
# ... your code ...
ZeynX92 commented 2 years ago

DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:root:Requesting(POST)https://aternos.org/panel/ajax/account/login.php
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={'TOKEN': '3sQ37gsLikXk2kuwZn3M', 'SEC': 'av23ungzrf000000:2kz9ewszhyg00000'}
DEBUG:root:data={'user': 'world35g', 'password': '0efdb2cd6b36d5e54d0e3c161e567a4e'}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_av23ungzrf000000=2kz9ewszhyg00000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "POST /panel/ajax/account/login.php?TOKEN=3sQ37gsLikXk2kuwZn3M&SEC=av23ungzrf000000%3A2kz9ewszhyg00000 HTTP/1.1" 418 None
INFO:root:POST completed with 418 status
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:root:Requesting(POST)https://aternos.org/panel/ajax/account/login.php
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={'TOKEN': '3sQ37gsLikXk2kuwZn3M', 'SEC': '25q77ros0ua00000:1rl17hv57xh00000'}
DEBUG:root:data={'user': 'world35g', 'password': '0efdb2cd6b36d5e54d0e3c161e567a4e'}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_25q77ros0ua00000=1rl17hv57xh00000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "POST /panel/ajax/account/login.php?TOKEN=3sQ37gsLikXk2kuwZn3M&SEC=25q77ros0ua00000%3A1rl17hv57xh00000 HTTP/1.1" 418 None
INFO:root:POST completed with 418 status
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:root:Requesting(POST)https://aternos.org/panel/ajax/account/login.php
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={'TOKEN': '3sQ37gsLikXk2kuwZn3M', 'SEC': 'wnjl1pahqn000000:1660dv9z40j00000'}
DEBUG:root:data={'user': 'world35g', 'password': '0efdb2cd6b36d5e54d0e3c161e567a4e'}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_wnjl1pahqn000000=1660dv9z40j00000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "POST /panel/ajax/account/login.php?TOKEN=3sQ37gsLikXk2kuwZn3M&SEC=wnjl1pahqn000000%3A1660dv9z40j00000 HTTP/1.1" 418 None
INFO:root:POST completed with 418 status
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:root:Requesting(POST)https://aternos.org/panel/ajax/account/login.php
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={'TOKEN': '3sQ37gsLikXk2kuwZn3M', 'SEC': 'msriqagb0d000000:5upr3yylgo000000'}
DEBUG:root:data={'user': 'world35g', 'password': '0efdb2cd6b36d5e54d0e3c161e567a4e'}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_msriqagb0d000000=5upr3yylgo000000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "POST /panel/ajax/account/login.php?TOKEN=3sQ37gsLikXk2kuwZn3M&SEC=msriqagb0d000000%3A5upr3yylgo000000 HTTP/1.1" 418 None
INFO:root:POST completed with 418 status
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:root:Requesting(POST)https://aternos.org/panel/ajax/account/login.php
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={'TOKEN': '3sQ37gsLikXk2kuwZn3M', 'SEC': 'cq6cdqbz4wd00000:1thmnvmnwla00000'}
DEBUG:root:data={'user': 'world35g', 'password': '0efdb2cd6b36d5e54d0e3c161e567a4e'}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_cq6cdqbz4wd00000=1thmnvmnwla00000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "POST /panel/ajax/account/login.php?TOKEN=3sQ37gsLikXk2kuwZn3M&SEC=cq6cdqbz4wd00000%3A1thmnvmnwla00000 HTTP/1.1" 418 None
INFO:root:POST completed with 418 status
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:root:Requesting(POST)https://aternos.org/panel/ajax/account/login.php
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={'TOKEN': '3sQ37gsLikXk2kuwZn3M', 'SEC': '2fc3fneo4kc00000:4vg5tyx8yzb00000'}
DEBUG:root:data={'user': 'world35g', 'password': '0efdb2cd6b36d5e54d0e3c161e567a4e'}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_2fc3fneo4kc00000=4vg5tyx8yzb00000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "POST /panel/ajax/account/login.php?TOKEN=3sQ37gsLikXk2kuwZn3M&SEC=2fc3fneo4kc00000%3A4vg5tyx8yzb00000 HTTP/1.1" 418 None
INFO:root:POST completed with 418 status
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:root:Requesting(POST)https://aternos.org/panel/ajax/account/login.php
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={'TOKEN': '3sQ37gsLikXk2kuwZn3M', 'SEC': '22ozqqpijcz00000:3z4szw0lgsk00000'}
DEBUG:root:data={'user': 'world35g', 'password': '0efdb2cd6b36d5e54d0e3c161e567a4e'}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_22ozqqpijcz00000=3z4szw0lgsk00000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "POST /panel/ajax/account/login.php?TOKEN=3sQ37gsLikXk2kuwZn3M&SEC=22ozqqpijcz00000%3A3z4szw0lgsk00000 HTTP/1.1" 418 None
INFO:root:POST completed with 418 status
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:disnake.gateway:Keeping shard ID None websocket alive with sequence 6.
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:root:Requesting(POST)https://aternos.org/panel/ajax/account/login.php
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={'TOKEN': '3sQ37gsLikXk2kuwZn3M', 'SEC': '8gmirmjwuy900000:5ny9jvc9bzi00000'}
DEBUG:root:data={'user': 'world35g', 'password': '0efdb2cd6b36d5e54d0e3c161e567a4e'}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_8gmirmjwuy900000=5ny9jvc9bzi00000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "POST /panel/ajax/account/login.php?TOKEN=3sQ37gsLikXk2kuwZn3M&SEC=8gmirmjwuy900000%3A5ny9jvc9bzi00000 HTTP/1.1" 418 None
INFO:root:POST completed with 418 status
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:root:Requesting(POST)https://aternos.org/panel/ajax/account/login.php
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={'TOKEN': '3sQ37gsLikXk2kuwZn3M', 'SEC': '11qehjt1kqk00000:o3n0o88g77000000'}
DEBUG:root:data={'user': 'world35g', 'password': '0efdb2cd6b36d5e54d0e3c161e567a4e'}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_11qehjt1kqk00000=o3n0o88g77000000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "POST /panel/ajax/account/login.php?TOKEN=3sQ37gsLikXk2kuwZn3M&SEC=11qehjt1kqk00000%3Ao3n0o88g77000000 HTTP/1.1" 418 None
INFO:root:POST completed with 418 status
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
WARNING:retry.api:Unable to parse TOKEN from the page, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:root:Requesting(POST)https://aternos.org/panel/ajax/account/login.php
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={'TOKEN': '3sQ37gsLikXk2kuwZn3M', 'SEC': '5l3av1ijv0900000:2ehgskm7w8000000'}
DEBUG:root:data={'user': 'world35g', 'password': '0efdb2cd6b36d5e54d0e3c161e567a4e'}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_5l3av1ijv0900000=2ehgskm7w8000000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "POST /panel/ajax/account/login.php?TOKEN=3sQ37gsLikXk2kuwZn3M&SEC=5l3av1ijv0900000%3A2ehgskm7w8000000 HTTP/1.1" 418 None
INFO:root:POST completed with 418 status
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 200 None
INFO:root:GET completed with 200 status
DEBUG:root:Requesting(POST)https://aternos.org/panel/ajax/account/login.php
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={'TOKEN': '3sQ37gsLikXk2kuwZn3M', 'SEC': '81av6qwarp000000:15xftdfybfr00000'}
DEBUG:root:data={'user': 'world35g', 'password': '0efdb2cd6b36d5e54d0e3c161e567a4e'}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[<Cookie ATERNOS_LANGUAGE=en for aternos.org/>, <Cookie ATERNOS_SEC_81av6qwarp000000=15xftdfybfr00000 for aternos.org/>]>
DEBUG:urllib3.connectionpool:https://aternos.org:443 "POST /panel/ajax/account/login.php?TOKEN=3sQ37gsLikXk2kuwZn3M&SEC=81av6qwarp000000%3A15xftdfybfr00000 HTTP/1.1" 418 None
INFO:root:POST completed with 418 status
WARNING:retry.api:Check your username and password, retrying in 0 seconds...
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:GET completed with 403 status
DarkCat09 commented 2 years ago

403 = Looks like some bugs in cloudscraper, a module to bypass Cloudflare protection.
418 = "I'm a teapot", Aternos sometimes returns this code, but I don't remember why it happens.

I'll check my code tomorrow. But, if you want, you should try to login with enabled Russian VPN. I think there may be some Cloudflare or Aternos checks based on the IP location.

DarkCat09 commented 2 years ago

Because I'm in Russia and I don't have this problem.

ZeynX92 commented 2 years ago

Я тоже, но эта проблема просто существует...

ZeynX92 commented 2 years ago
Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare

Мне кажется или что-то поменялось?

DarkCat09 commented 2 years ago

Логи чутка поменялись. Хотя бы теперь cloudflare что-то делает.

DarkCat09 commented 2 years ago

До этого он просто разрешал запросы, теперь хоть что-то блокирует.

ZeynX92 commented 2 years ago

Хм... Интересно почему...

DarkCat09 commented 2 years ago

Действительно, почему же, после нескольких десятков запросов!) Retry наверняка успел повторить уже 20 раз функцию, вот защита и среагировала.

ZeynX92 commented 2 years ago

Т.е. убрать retry?

ZeynX92 commented 2 years ago

Т.е. убрать retry?

Ничего не поменялось : (

DarkCat09 commented 2 years ago

Пока не надо, всё равно есть проблемы с парсингом (то 403, то функция токена не в том месте находится).

ZeynX92 commented 2 years ago

Понял

DarkCat09 commented 2 years ago

Предлагаю немного подождать, потом опять скрипт запустить. Клаудфлэр пусть успокоится.

ZeynX92 commented 2 years ago

Предлагаю немного подождать, потом опять скрипт запустить. Клаудфлэр пусть успокоится.

Хорошо, ему хватит 24 часа?)

DarkCat09 commented 2 years ago

Да и 10 минут должно хватить.
Завтра на компе посмотрю, что не так.

ZeynX92 commented 2 years ago

}{орошо, спасибо, буду ждать))

DarkCat09 commented 2 years ago

Реально странно. Люди иногда в issue пишут, что у них CredentialsError, а у меня всё работает.

ZeynX92 commented 2 years ago

Я сам замечал, что порой она вылетала, но с retry все работало... До определенного момента...

ZeynX92 commented 2 years ago

Реально странно. Люди иногда в issue пишут, что у них CredentialsError, а у меня всё работает.

Тут, наверное, проблема в самом Aternos, а не в вашем коде, т.к. сервера Aternosа довольно не стабильны....

DarkCat09 commented 2 years ago

Были бы деньги, была бы и стабильность. А проект бесплатный.
Мне их было жалко до тех пор, пока они не стали показывать видеорекламу, из-за которой ужасно лагает слабый планшет, и вот тогда я поставил uBlock origin.
Теперь API пишу, ибо сайт у них тоже не самый удобный.

ZeynX92 commented 2 years ago

Полностью с вами согласен)

ZeynX92 commented 2 years ago

Спустя 10 мин:



DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org```
DarkCat09 commented 2 years ago

А больше ничего нету? Тут только запрос для получения токена.

ZeynX92 commented 2 years ago

Это все что есть, но разве это не повторение?

DEBUG:disnake.client:Dispatching event slash_command
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): aternos.org:443
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DarkCat09 commented 2 years ago

Вы правы, запросы повторяются. Хорошо, попробуйте завтра ещё раз, 403 cloudflare возвращает.

ZeynX92 commented 2 years ago

Хорошо

ZeynX92 commented 2 years ago

И снова здравствуйте! Ошибка осталась...

ZeynX92 commented 2 years ago

INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.4.0.2'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org```
DarkCat09 commented 2 years ago

Здравствуйте. Похоже, что проблема в самом методе прохождения cloudflare. Сейчас посмотрю.

DarkCat09 commented 2 years ago

Клаудфлэр у меня, опять-таки, не блокирует ничего, но при попытке войти в аккаунт Aternos говорит, что он чайник и не может сварить кофе (т.е. ошибка 418 I'm a teapot).

DarkCat09 commented 2 years ago

https://developer.mozilla.org/ru/docs/Web/HTTP/Status/418

DarkCat09 commented 2 years ago

Обновитесь, пожалуйста, на свежий релиз. Исправил всё вроде.

ZeynX92 commented 2 years ago

Здравствуйте! Интересная ситуация server.stop() сработал, а вот start() нет.

DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers=None
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers=None
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
ZeynX92 commented 2 years ago

И да, я на последнем релизе: python-aternos 1.0.2

ZeynX92 commented 2 years ago

А-а! Все стало еще интереснее убрал тестовый вывод списка серверов и вроде оно заработало...

ZeynX92 commented 2 years ago

Спасибо большое за оперативную помощь в решении проблем. Если честно, не часто встречаю таких разработчиков, удачи вам во всех проектах и пусть код всегда запускается с первого раза : )

DarkCat09 commented 2 years ago
DEBUG:root:headers=None

Я опять всё сломал... В заголовки не отправляется User-Agent, поэтому cloudflare опять не верит, что это обычный пользователь. Баг уже нашёл, одну строчку просто добавить надо.

не часто встречаю таких разработчиков, удачи вам во всех проектах и пусть код всегда запускается с первого раза

Спасибо, рад слышать)

ZeynX92 commented 2 years ago
DEBUG:root:headers=None

Я опять всё сломал... В заголовки не отправляется User-Agent, поэтому cloudflare опять не верит, что это обычный пользователь. Баг уже нашёл, одну строчку просто добавить надо.

не часто встречаю таких разработчиков, удачи вам во всех проектах и пусть код всегда запускается с первого раза

Спасибо, рад слышать)

Здравствуйте! А когда будет выкачен Update с этим багфиксом в pip?

DarkCat09 commented 2 years ago

Я понял, в каком случае cloudflare отклоняет запрос.
Обновляйтесь, 1.0.3.

DarkCat09 commented 2 years ago

Ну как, работает?

ZeynX92 commented 2 years ago

Здравствуйте! Извините был завален учебой, а так, к сожалению нет(

INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'Host': 'aternos.org', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36 OPR/85.0.4341.47', 'Sec-Ch-Ua': '" Not A;Brand";v="99", "Chromium";v="100", "Opera";v="86"', 'Sec-Ch-Ua-Mobile': '?0', 'Sec-Ch-Ua-Platform': '"Linux"', 'Sec-Fetch-Dest': 'document', 'Sec-Fetch-Mode': 'navigate', 'Sec-Fetch-Site': 'same-origin', 'Sec-Fetch-User': '?1', 'Upgrade-Insecure-Requests': '1'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
INFO:root:Retrying to bypass Cloudflare
DEBUG:root:Requesting(GET)https://aternos.org/go/
DEBUG:root:headers={'Host': 'aternos.org', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36 OPR/85.0.4341.47', 'Sec-Ch-Ua': '" Not A;Brand";v="99", "Chromium";v="100", "Opera";v="86"', 'Sec-Ch-Ua-Mobile': '?0', 'Sec-Ch-Ua-Platform': '"Linux"', 'Sec-Fetch-Dest': 'document', 'Sec-Fetch-Mode': 'navigate', 'Sec-Fetch-Site': 'same-origin', 'Sec-Fetch-User': '?1', 'Upgrade-Insecure-Requests': '1'}
DEBUG:root:params={}
DEBUG:root:data={}
DEBUG:root:req-cookies={'ATERNOS_SESSION': ''}
DEBUG:root:session-cookies=<RequestsCookieJar[]>
DEBUG:urllib3.connectionpool:Resetting dropped connection: aternos.org
DEBUG:urllib3.connectionpool:https://aternos.org:443 "GET /go/ HTTP/1.1" 403 None
flancast90 commented 2 years ago

I have this same issue. Everything works well in localhost, but as soon as I run from a VPS (in my case Repl.it) I begin getting the token error. Any updates on how to fix?

DarkCat09 commented 2 years ago

I think Cloudflare blocks requests from repl.it due to incorrect headers or IP address explained in #16 by @sleeyax (thanks).
Try to change the REQUA field:

from python_aternos import Client, atconnect
aternos = Client(atconnect.AternosConnect())

# empty User-Agent
aternos.atconn.REQUA = ''

aternos.atconn.cookies.set('ATERNOS_SESSION', yourcookies)
s = aternos.list_servers()
print(s)

If it doesn't work, ... please, don't use repl.it, I have no idea why this happens.

ZeynX92 commented 2 years ago

@DarkCat09 Здравствуйте! А по моему вопросу что-нибудь прояснилось?) Или же мне нужно использовать код выше?