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 44 commits into
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. |
- Add `silent_mode` column to `Setting` model and `get_silent_mode()` function to allow users to suppress progress updates. - Update `edit_text()` method to skip sending progress when silent mode is active. - Add `_reencode_videos()` method using `ensure_streamable_video` to convert non-streamable videos to mp4/h264 for Telegram compatibility. - Show download percentage in progress display.
feat: add silent mode and video re-encoding features
feat: pequeño cambio
…e reference - Replace pathlib imports with Path in helper.py, instagram.py, pixeldrain.py; remove unused import in direct.py - Fix krakenfiles.py: use BeautifulSoup.select_one instead of non-existent xpath method - Fix main.py: use BotText.private attribute instead of bare string - Add BotText.private constant in config/constant.py
fix: correct pathlib imports, krakenfiles parsing, and BotText.privat…
…liability - In base.py, skip thumbnails/images when selecting video file in get_metadata. - In generic.py, fix format selection for non-YouTube URLs and add format_sort option. - In helper.py, switch to ffmpeg-python wrapper for better error handling, timeout, and output validation. - In main.py, remove unused queue counter and position tracking; simplify queue position update.
fix: improve video file detection and refactor ffmpeg encoding for re…
…upport - Configure Cloudflare DNS (1.1.1.1, 1.0.0.1) in docker-compose.yml - Update pdm.lock to include ai-cloudscraper and other dependency additions - Enhance network reliability and bypass capabilities
feat: add custom DNS and update dependencies with Cloudflare bypass s…
- Modified .gitignore to standardize Python project exclusions including virtual environments, test caches, build artifacts, OS files, logs, and editor files - Updated src/engine/helper.py to reduce maximum video resolution from 1080p to 720p in ensure_streamable_video function for re-encoded videos - Kept existing test file src/test_convert_webm.py which validates webm to mp4 conversion workflow The changes standardize repository ignore patterns and optimize video processing by capping output resolution at 720p instead of 1080p, while maintaining existing test coverage for the conversion process.
…n-conversion-417ad Optimizing video resolution conversion 417ad
- Updated README.md to document new features including automatic video conversion to 720p, smart scaling logic, and enhanced FFmpeg integration - Modified .gitignore to streamline ignored files and directories - Enhanced video processing in src/engine/helper.py with improved `ensure_streamable_video` function using smarter scaling logic to resize videos to max 720p while preserving aspect ratio - Added comprehensive test suite in src/test_convert_webm.py to validate the new video conversion and scaling logic with synthetic webm inputs
…loader-8b357 Update from task 4afd7062-7535-4bbc-9b0d-ebea3b38b357
Key features implemented: - Modified src/engine/base.py to always call _reencode_videos during upload, ensuring all videos are processed even from cache - Updated src/engine/helper.py's ensure_streamable_video to re-encode videos exceeding 720p resolution, regardless of being MP4/H.264 already - Refactored README.md to highlight automatic video conversion and smart scaling features - Adjusted .gitignore for cleaner file tracking - Enhanced test suite in src/test_convert_webm.py to validate 720p scaling logic The changes enforce consistent video output at 720p maximum resolution for optimal Telegram playback, improving user experience by standardizing video quality across different source formats.
…loader-8b357 Update from task 4afd7062-7535-4bbc-9b0d-ebea3b38b357
…loader-8b357 Update from task 4afd7062-7535-4bbc-9b0d-ebea3b38b357
…loader-8b357 Update from task 4afd7062-7535-4bbc-9b0d-ebea3b38b357
feat: correcion de bug
fix: correcion de bug 2
fix: solucion de bug 3
fix: solucion de un bug de algunos archivos no se llega a enviar a te…
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