Restricted Content Downloader: An advanced Telegram bot script to download restricted content such as photos, videos, audio files, or documents from Telegram private chats or channels. This bot can also copy text messages from Telegram posts.
- 📥 Download media (photos, videos, audio, documents).
- ✅ Supports downloading from both single media posts and media groups.
- 🔄 Progress bar showing real-time downloading progress.
- ✍️ Copy text messages or captions from Telegram posts.
Before you begin, ensure you have met the following requirements:
- Python 3.8 or higher. recommended Python 3.11
pyrofork,pyleavesandtgcryptolibraries.- A Telegram bot token (you can get one from @BotFather on Telegram).
- API ID and Hash: You can get these by creating an application on my.telegram.org.
- To Get
SESSION_STRINGOpen @SmartUtilBot. Bot and use /pyro command and then follow all instructions.
To install pyrofork, pyleaves and tgcrypto, run the following command:
pip install -r -U requirements.txtNote: If you previously installed pyrogram, uninstall it before installing pyrofork.
- Open the
config.envfile in your favorite text editor. - Replace the placeholders for
API_ID,API_HASH,SESSION_STRING, andBOT_TOKENwith your actual values:API_ID: Your API ID from my.telegram.org.API_HASH: Your API Hash from my.telegram.org.SESSION_STRING: The session string generated using @SmartUtilBot.BOT_TOKEN: The token you obtained from @BotFather.
git clone https://github.com/rijj1/RestrictedContentDLBot
cd RestrictedContentDLBot
python main.pygit clone https://github.com/rijj1/RestrictedContentDLBot
cd RestrictedContentDLBot
docker compose up --build --remove-orphansMake sure you have Docker and Docker Compose installed on your system. The bot will run in a containerized environment with all dependencies automatically managed.
To stop the bot:
docker compose down-
/start– Welcomes you and gives a brief introduction. -
/help– Shows detailed instructions and examples. -
/dl <post_URL>or simply paste a Telegram post link – Fetch photos, videos, audio, or documents from that post. -
/bdl <start_link> <end_link>– Batch-download a range of posts in one go.💡 Example:
/bdl https://t.me/mychannel/100 https://t.me/mychannel/120 -
/killall– Cancel any pending downloads if the bot hangs. -
/logs– Download the bot’s logs file. -
/stats– View current status (uptime, disk, memory, network, CPU, etc.).
Note: Make sure that your user session is a member of the source chat or channel before downloading.
- Name: Rij1
- Telegram: @rijj_1
Note: If you found this repo helpful, please fork and star it. Also, feel free to share with proper credit!