Download, clone, and re-upload restricted Telegram content with production-grade reliability.
TelegramRestrictionBypass is a Python Telegram automation bot that can fetch and re-upload media from Telegram links, including content that cannot be forwarded directly. It supports both bot-based and user-session-based retrieval, so you can handle public, private, and restricted workflows from one tool.
- Forward restrictions block normal workflows for backup and migration
- Large media archives need reliability with resume-safe processing
- Power users need scale through multi-bot workers and runtime controls
- Developers need extensibility in a clear Python codebase
It is designed for developers, channel admins, and power users who need dependable media backup, migration, and archival pipelines with worker scaling and operational safety.
- Restricted-content bypass using download and re-upload flow
- Dual modes:
- BOT mode for bot-accessible chats
- USER mode for restricted/private access with
SESSION_STRING
- Single, batch, and full clone commands:
/dl,/bdl,/clone - Multi-bot worker pool with round-robin upload distribution
- Crash-safe auto-resume for interrupted single and batch tasks
- Strict order mode or concurrent fast mode
- Media group support for Telegram albums
- Destination channel support (dump channel)
- Source history tracking and runtime dashboard controls
Runtime experience is centered around an interactive Telegram dashboard and command-driven flow:
/start -> opens dashboard
/dl -> single message download/re-upload
/bdl -> range batch processing with progress
/clone -> full channel clone from any message link
Detailed command workflows and scenarios: docs/EXAMPLES.md
- Python 3.11+
- Pyrofork (Pyrogram fork)
- TgCrypto
- Pyleaves
- python-dotenv
- psutil
- Pillow
- FFmpeg
- Docker / Docker Compose (optional)
- Python
3.11+ - FFmpeg
- Telegram API credentials from my.telegram.org
- At least one bot token from @BotFather
- Optional:
SESSION_STRINGfor USER mode
git clone https://github.com/Paidguy/TelegramRestrictionBypass.git
cd TelegramRestrictionBypass
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
cp config.env.example config.envIf venv creation fails on Debian/Ubuntu:
sudo apt install -y python3-venvSet these in config.env:
API_IDAPI_HASHBOT_TOKENSSESSION_STRING(optional, required for USER mode)
python main.pyDetailed guides: docs/INSTALLATION.md, docs/SETUP.md
- Open your bot in Telegram
- Send
/start - Run commands
/dl <telegram_message_link>
/bdl <start_message_link> <end_message_link>
/clone <any_message_link_from_target_channel>
/connect <bot_token> # add worker bot at runtime
/auth <user_id> # authorize another user (owner only)
/clean # remove temporary downloaded files
/logs # receive logs.txt
/join <invite_or_username> # USER mode: join target chat first
/dl https://t.me/durov/123
/bdl https://t.me/c/123456789/100 https://t.me/c/123456789/500
/clone https://t.me/c/123456789/250
More practical workflows: docs/EXAMPLES.md
TelegramRestrictionBypass/
βββ main.py
βββ config.py
βββ logger.py
βββ requirements.txt
βββ Dockerfile
βββ docker-compose.yml
βββ docs/
β βββ README.md
β βββ ARCHITECTURE.md
β βββ CONFIGURATION.md
β βββ EXAMPLES.md
β βββ INSTALLATION.md
β βββ SETUP.md
β βββ QUICKSTART.md
β βββ DOCKER.md
β βββ DEPENDENCIES.md
βββ helpers/
βββ files.py
βββ msg.py
βββ settings.py
βββ state.py
βββ utils.py
- docs/README.md
- docs/ARCHITECTURE.md
- docs/CONFIGURATION.md
- docs/EXAMPLES.md
- docs/INSTALLATION.md
- docs/DOCKER.md
Primary runtime variables:
API_ID,API_HASHBOT_TOKENS(comma-separated worker tokens)SESSION_STRINGMAX_CONCURRENT_DOWNLOADSFLOOD_WAIT_DELAYBATCH_SIZE
Full reference: docs/CONFIGURATION.md
Contributions are welcome.
- Fork the repository
- Create a feature branch
- Run formatting/lint checks
- Open a clear pull request with context and test notes
Contribution guide: CONTRIBUTING.md
- Maintained by Paidguy
- Based on concepts and earlier work from RestrictedContentDL by bisnuray
Attribution and licensing are preserved per project history and MIT terms.
This project is licensed under the MIT License. See LICENSE.
You are responsible for how you use this software. Always comply with Telegram Terms of Service, copyright law, and local regulations.