feature: addition of a Cloudflare bypass for the anti-bot#577
feature: addition of a Cloudflare bypass for the anti-bot#577yeshua-aguilar wants to merge 9 commits intotgbot-collection:masterfrom
Conversation
feat: Add Cloudflare bypass support for direct downloads
There was a problem hiding this comment.
We use personal API for this. So no need for additional workarounds here.
There was a problem hiding this comment.
yt-dlp handles this part on own, specially for YT. Why do we need to manually inject headers here?
I need your opinion.
There was a problem hiding this comment.
What about aria2 part?
Do you have any suggestions?
|
Hi @yeshua-aguilar , Thank you for your interest in the project and for submitting this PR! I left some comments on the code, but I had a few general questions:
Appreciate the help! |
|
Hi @SanujaNS , thanks for the feedback! Let me address each point: Version: I'll switch to Context Implementation Great point, You're right that:
|
refactor: switch to ai-cloudscraper, scope bypass to direct.py only
|
Hi @yeshua-aguilar , Sorry about the delayed response and thank you for the update. I will go through the changes and get back to you. |
Summary
Adds automatic Cloudflare bypass support to avoid anti-bot detection when downloading videos from protected websites.
Problem
Many websites use Cloudflare protection which blocks bot requests, even for legitimate video downloads. This causes failures when users try to download content from these sites.
Solution
Implemented a new HTTP client module using
cloudscraperlibrary that:BYPASS_CLOUDFLAREenv variableFiles Changed
pyproject.tomlcloudscraper>=1.2.71requirements.txtcloudscraper>=1.2.71src/utils/http_client.pysrc/config/config.pyBYPASS_CLOUDFLAREsettingsrc/engine/direct.pysrc/engine/generic.pysrc/engine/instagram.py.env.exampleTesting
Configuration
.env
BYPASS_CLOUDFLARE=True # Default: True
Dependencies