Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Unable to bypass Cloudflare protection on Heroku, Replit, etc. #25

Closed
RuochenFu21 opened this issue Jun 18, 2022 · 13 comments
Closed

Unable to bypass Cloudflare protection on Heroku, Replit, etc. #25

RuochenFu21 opened this issue Jun 18, 2022 · 13 comments
Labels
update Aternos API or security methods were changed

Comments

@RuochenFu21
Copy link
Contributor

Unable to bypass Cloudflare protection

@whirlwindnoa
Copy link

Same issue

@DarkCat09
Copy link
Owner

DarkCat09 commented Jun 20, 2022

I'm already working on it.
The probably solution is to send requests with selenium instead of requests+lxml. It's not so fast, I have to rewrite nearly half of the code.

The problem may be caused by the easy to detect Python's HTTP stack or Heroku/Replit IP addresses.

@whirlwindnoa
Copy link

I'm already working on it. The probably solution is to send requests with selenium instead of requests+lxml. It's not so fast, I have to rewrite nearly half of the code.

The problem may be caused by the easy to detect Python's HTTP stack or Heroku/Replit IP addresses.

Seems like after I tried running the application on my own PC, the problem has been solved. Probably Replit/Heroku IP addresses are unable to bypass Cloudflare's captcha.

@DarkCat09 DarkCat09 changed the title Unable to bypass Cloudflare protection Unable to bypass Cloudflare protection on Heroku, Replit, etc. Jul 1, 2022
@Aftermathic
Copy link

Aftermathic commented Jul 20, 2022

doing with replit and making it with a discord bot gave me the same errors

from python_aternos import Client

from webserver import keep_alive

import discord
from discord.ext import commands

client = discord.Client()
bot = commands.Bot(command_prefix='{', help_command=None)

@bot.command()
async def startServer(ctx):
    try:
        aternos = Client.from_credentials("test", "test")
    except Exception as e:
        await ctx.send("Couldn't log in.")
        await ctx.send(f"Error: {e}")
    else:
        servs = aternos.list_servers()

        for serv in servs:
            if serv.address == 'test':
                myserver = serv

        try:
            myserver.start()
        except:
            await ctx.send("Server couldn't open.")
        else:
            await ctx.send("SERVER SUCESSFULLY OPENED!\nServer Address: aftermathicsmp.aternos.me\nPort: 24119")

keep_alive()
bot.run(os.environ['bot_token'])```

@DewanshNehra
Copy link

I'm already working on it. The probably solution is to send requests with selenium instead of requests+lxml. It's not so fast, I have to rewrite nearly half of the code.

The problem may be caused by the easy to detect Python's HTTP stack or Heroku/Replit IP addresses.

any updates on the cloudfare bypass ?. I have tried to run it on every platform on heroku , replit and even hosted it on my own vps but did not worked same could not bypass cloudflare but it is working fine on windows like on local machine but fails on a vps or other service. So just wanna know if any updates were coming or not ?

@DarkCat09
Copy link
Owner

DarkCat09 commented Jul 24, 2022

@DewanshNehra, I decided to parse Cloudflare page with js2py, because selenium requires installed browser.
I hope I'll do it. Wait for some news tomorrow.

@RuochenFu21
Copy link
Contributor Author

@DarkCat09 doesnt work on my own laptop also(need more than 5 trys)

@Kinuseka
Copy link

I'm already working on it. The probably solution is to send requests with selenium instead of requests+lxml. It's not so fast, I have to rewrite nearly half of the code.

The problem may be caused by the easy to detect Python's HTTP stack or Heroku/Replit IP addresses.

Hi, if ever cloudscraper returns an error. Why not use undetected-chromedriver, collect the cookies and browser header and use the collected cookies to the requests module. It works all the time. Let me know if you want more information

@ozcankrks
Copy link

is the problem solved?

@DarkCat09
Copy link
Owner

I did it! To bypass Cloudflare, python-aternos need to update requests.Session and wait before each new attempt.
Details: dc52f92#diff-13f0cf5511b5689db9ce01d005de5d7e9a75537bac16c7c8dd35e39a70a14b49R201

@DarkCat09
Copy link
Owner

Update to the latest version: v1.1.2

@DarkCat09
Copy link
Owner

And I've checked it on Repl.it, cloudscraper works: https://replit.com/@DCat09/PythonAternosTest

@DarkCat09
Copy link
Owner

If the problem will appear again, reopen this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
update Aternos API or security methods were changed
Projects
None yet
Development

No branches or pull requests

7 participants