Skip to content

RestrictedContentDL is a Telegram bot script that allows you to download media from restricted channels and groups, both public and private. The bot can handle photos, videos, audio, documents, and text messages, making it a versatile tool for managing Telegram content.

License

Notifications You must be signed in to change notification settings

apomgran/RestrictedContentDL

 
 

Repository files navigation

Latest Release Version Two Still Some Bugs In 30 Sites Download Upload

Important Note :

Telegram | See Recent Updates

Live Bot Here

See Our Live Bot On Telegram ᴘʀɪᴠᴀᴛᴇ ᴄᴏɴᴛᴇɴᴛ ғᴏʀᴡᴀʀᴅᴇʀ ʙᴏᴛ

📚 About This Branch

  • This branch is based on Pyrogram V2 offering enhanced stability and a forced login feature. User are not forced to login in bot for public channels but for public groups and private channel they have to do login.
  • for detailed features scroll down to features section

🔧 Features

  • Extract content from both public and private channels/groups.
  • Rename and forward content to other channels or users.
  • extract restricted content from other bots how to use format link like https://b/botusername(without @)/message_id(get it from plus messenger)
  • /login method along with session based login
  • Custom captions and thumbnails.
  • Auto-remove default video thumbnails.
  • Delete or replace words in filenames and captions.
  • Auto-pin messages if enabled.
  • download yt/insta/Twitter/fb ect normal ytdlp supported sites that supports best format
  • Login via phone number.
  • Supports 4GB file uploads: The bot can handle large file uploads, up to 4GB in size.
  • file splitter if not premium string
  • Enhanced Timer: Distinct timers for free and paid users to limit usage and improve service.
  • Improved Looping: Optimized looping for processing multiple files or links, reducing delays and enhancing performance.
  • Premium Access: Premium users enjoy faster processing speeds and priority queue management.
  • ads setup shorlink ads token system
  • fast uploader via SpyLib using Telethon modules and mautrix bridge repo
  • Directly upload to topic in any topic enabled group

⚡ Commands

  • start: 🚀 Start the bot.
  • batch: 🫠 Extract in bulk.
  • login: 🔑 Get into the bot.
  • logout: 🚪 Get out of the bot.
  • token: 🎲 Get 3 hours of free access.
  • adl: 👻 Download audio from 30+ sites.
  • dl: 💀 Download videos from 30+ sites.
  • transfer: 💘 Gift premium to others.
  • myplan: ⌛ Get your plan details.
  • add: ➕ Add user to premium.
  • rem: ➖ Remove user from premium.
  • session: 🧵 Generate Pyrogramv2 session.
  • settings: ⚙️ Personalize settings.
  • stats: 📊 Get stats of the bot.
  • plan: 🗓️ Check our premium plans.
  • terms: 🥺 Terms and conditions.
  • speedtest: 🚅 Check the server speed.
  • get: 🗄️ Get all user IDs.
  • lock: 🔒 Protect channel from extraction.
  • gcast: ⚡ Broadcast message to bot users.
  • help: ❓ Help if you're new.
  • cancel: 🚫 Cancel batch process.

Deploy to Heroku

Deploy Heroku

⚙️ Required Variables

Click to view required variables

To run the bot, you'll need to configure a few sensitive variables. Here's how to set them up securely:

  • API_ID: Your API ID from telegram.org.
  • API_HASH: Your API Hash from telegram.org.
  • BOT_TOKEN: Get your bot token from @BotFather.
  • OWNER_ID: Use @ItsSmartToolBot to get your user ID by sending /info.
  • CHANNEL_ID: The ID of the channel for forced subscription.
  • LOG_GROUP: A group or channel where the bot logs messages. Forward a message to @userinfobot to get your channel/group ID.
  • MONGO_DB: A MongoDB URL for storing session data (recommended for security).

Additional Configuration Options:

  • STRING: (Optional) Add your premium account session string here to allow 4GB file uploads. This is optional and can be left empty if not used.
  • FREEMIUM_LIMIT: Default is 0. Set this to any value you want to allow free users to extract content. If set to 0, free users will not have access to any extraction features.
  • PREMIUM_LIMIT: Default is 500. This is the batch limit for premium users. You can customize this to allow premium users to process more links/files in one batch.
  • YT_COOKIES: Yt cookies for downloading yt videos
  • INSTA_COOKIES: If you want to enable instagram downloading fill cookiesn

How to get cookies ?? : use mozila firfox if on android or use chrome on desktop and download extension get this cookie or any Netscape Cookies (HTTP Cookies) extractor and use that

Monetization (Optional):

  • WEBSITE_URL: (Optional) This is the domain for your monetization short link service. Provide the shortener's domain name, for example: upshrink.com. Do not include www or https://. The default link shortener is already set.
  • AD_API: (Optional) The API key from your link shortener service (e.g., Upshrink, AdFly, etc.) to monetize links. Enter the API provided by your shortener.

Important: Always keep your credentials secure! Never hard-code them in the repository. Use environment variables or a .env file.


🚀 Deployment Guide

Deploy on VPS
  1. Fork the repo.
  2. Update config.py with your values.
  3. Run the following:
    sudo apt update
    sudo apt install ffmpeg git python3-pip
    git clone your_repo_link
    cd your_repo_name
    pip3 install -r requirements.txt
    python3 -m RestrictDL
  • To run the bot in the background:
    screen -S RestrictDL
    python3 -m RestrictDL
    • Detach: Ctrl + A, then Ctrl + D
    • To stop: screen -r gagan and screen -S gagan -X quit
Deploy on Heroku
  1. Fork and Star the repo.
  2. Click Deploy on Heroku.
  3. Enter required variables and click deploy ✅.
Deploy on Render
  1. Fork and star the repo.
  2. Edit config.py or set environment variables on Render.
  3. Go to render.com, sign up/log in.
  4. Create a new web service, select the free plan.
  5. Connect your GitHub repo and deploy ✅.
Deploy on Koyeb
  1. Fork and star the repo.
  2. Edit config.py or set environment variables on Koyeb.
  3. Create a new service, select Dockerfile as build type.
  4. Connect your GitHub repo and deploy ✅.

⚠️ Must Do: Secure Your Sensitive Variables

Do not expose sensitive variables (e.g., API_ID, API_HASH, BOT_TOKEN) on GitHub. Use environment variables to keep them secure.

Configuring Variables Securely:

  • On VPS or Local Machine:

    • Use a text editor to edit config.py:
      nano config.py
    • Alternatively, export as environment variables:
      export API_ID=your_api_id
      export API_HASH=your_api_hash
      export BOT_TOKEN=your_bot_token
  • For Cloud Platforms (Heroku, Railway, etc.):

    • Set environment variables directly in your platform’s dashboard.
  • Using .env File:

    • Create a .env file and add your credentials:
      API_ID=your_api_id
      API_HASH=your_api_hash
      BOT_TOKEN=your_bot_token
      
    • Make sure to add .env to .gitignore to prevent it from being pushed to GitHub.

Why This is Important? Your credentials can be stolen if pushed to a public repository. Always keep them secure by using environment variables or local configuration files.


Important Note

Note: Changing the terms and commands doesn't magically make you a developer. Real development involves understanding the code, writing new functionalities, and debugging issues, not just renaming things. If only it were that easy!

Special thanks to:

  • DevGagan For Main Project.
  • King of Patal for base development of this repository.
  • Mautrix Bridge for fast uploader connectivity bridge.
  • Me For Just Some Small Fixes And Upload Fix And ParseMode Issue Fix.

About

RestrictedContentDL is a Telegram bot script that allows you to download media from restricted channels and groups, both public and private. The bot can handle photos, videos, audio, documents, and text messages, making it a versatile tool for managing Telegram content.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.7%
  • Other 0.3%