Skip to content

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.

Notifications You must be signed in to change notification settings

bisnuray/RestrictedContentDL

Repository files navigation

Restricted Content Downloader Telegram Bot

GitHub Repo stars GitHub issues GitHub pull requests GitHub contributors GitHub forks

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.


Features

  • 📥 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.

Requirements

Before you begin, ensure you have met the following requirements:

  • Docker and Docker Compose installed on your system
  • 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_STRING Open @SmartUtilBot. Bot and use /pyro command and then follow all instructions

Note: All dependencies including Python, pyrofork, pyleaves, tgcrypto, and ffmpeg are automatically installed when you deploy with Docker Compose.

Configuration

  1. Open the config.env file in your favorite text editor.

  2. Replace the placeholders for API_ID, API_HASH, SESSION_STRING, and BOT_TOKEN with your actual values:

  3. Optional performance settings (add to config.py):

    • MAX_CONCURRENT_DOWNLOADS: Number of simultaneous downloads (default: 3)
    • BATCH_SIZE: Number of posts to process in parallel during batch downloads (default: 10)
    • FLOOD_WAIT_DELAY: Delay in seconds between batch groups to avoid flood limits (default: 3)

Deploy the Bot

  1. Clone the repository:

    git clone https://github.com/bisnuray/RestrictedContentDL
    cd RestrictedContentDL
  2. Start the bot:

    docker compose up --build --remove-orphans

The bot will run in a containerized environment with all dependencies (Python, libraries, FFmpeg) automatically installed and managed.

To stop the bot:

docker compose down

Usage

  • /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.

Author

Note: If you found this repo helpful, please fork and star it. Also, feel free to share with proper credit!

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published