This branch is based on Pyrogram V2
offering enhanced stability and a forced login feature. Users must log in to use the bot. For no-login usage, consider the v4
branch.
Do not expose sensitive variables (e.g., API_ID
, API_HASH
, BOT_TOKEN
) on GitHub. Use environment variables to keep them secure.
-
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
- Use a text editor to edit
-
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.
- Create a
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.
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.
- Extract content from both public and private channels/groups.
- Rename and forward content to other channels or users.
- 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 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.
- 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.
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 @missrose_bot 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).
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 is0
. Set this to any value you want to allow free users to extract content. If set to0
, free users will not have access to any extraction features.PREMIUM_LIMIT
: Default is500
. 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 videosINSTA_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
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 includewww
orhttps://
. 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.
Deploy on VPS
- Fork the repo.
- Update
config.py
with your values. - 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 devgagan
- To run the bot in the background:
screen -S gagan python3 -m devgagan
- Detach:
Ctrl + A
, thenCtrl + D
- To stop:
screen -r gagan
andscreen -S gagan -X quit
- Detach:
Deploy on Heroku
- Fork and Star the repo.
- Click Deploy on Heroku.
- Enter required variables and click deploy โ .
Deploy on Render
- Fork and star the repo.
- Edit
config.py
or set environment variables on Render. - Go to render.com, sign up/log in.
- Create a new web service, select the free plan.
- Connect your GitHub repo and deploy โ .
Deploy on Koyeb
- Fork and star the repo.
- Edit
config.py
or set environment variables on Koyeb. - Create a new service, select
Dockerfile
as build type. - Connect your GitHub repo and deploy โ .
Update: 24 DEC 2024
1. 4GB Upload Support
- New feature: The bot now supports uploading files as large as 4GB. This is particularly useful for users working with larger media content.
- How to enable: To allow 4GB file uploads, you must add your premium session string in the
STRING
variable in theconfig.py
file. This session string is only required for premium users.
2. New Upload Method
- A new, optimized upload method has been added for handling large file uploads more efficiently.
- What changed: Previously, large files could cause slow uploads or issues. This method helps avoid those problems and ensures smoother processing.
- Note: The upload method now handles large files seamlessly, reducing upload time and improving performance.
3. Fixed Blocking Issue
- Resolved blocking issues: We identified and fixed an issue that caused the bot to get blocked during the extraction or upload process, particularly when processing certain content.
- How it works now: The bot will continue to process and extract content without interruptions or blocks, improving reliability and reducing downtime.
4. Added /token
Method
- New command: A new
/token
method has been added for short link functionality. This command generates a token for using monetization features. - Configuration:
- To use this feature, you must configure the API key and URL for your short link provider.
- Fill in the
AD_API
(API key) andWEBSITE_URL
(short link service domain) in theconfig.py
. - Note: This feature is optional and only needed if you plan to use the bot for monetizing links.
5. Spylib Integration
- Spylib added: We have integrated Spylib functionality to enhance certain features. Spylib helps improve the botโs ability to extract and handle content.
- How to set up: For details on how to configure Spylib, refer to the Spylib Code Section in the README for a step-by-step guide.
6. Fixed Button Issues
- Fixed broken button functionality: There were issues where the botโs buttons were not responding or clicking properly. This has been resolved, and now the buttons will work as expected.
- Whatโs fixed: Buttons for commands like
/start
,/help
,/cancel
, and others should now work smoothly. 7. Added ytdlp back in this version: - You can use command /dl or /adl for enabling this fill up ytdlp vars i.e. YT_COOKIES and INSTA_COOKIES
1. Filename Deletion Behavior
-
Delete Word Behavior:
- If a word is added to the "delete words list", it will not be used in the filename. This ensures that unwanted words are completely excluded from the filenames.
- Example: If the word
deleteword
is added to the list, it will not appear in the filename under any circumstances.
-
Whatโs the catch:
- The delete word functionality now applies specifically to filenames only.
- For captions, you should use the replacement method (using spaces as a separator).
2. Deleting Words in Captions
- How to delete words in captions:
- If you want to delete words from captions, you should use the replacement method, where the word will be replaced with a space (
<space>
). - This will ensure that words are replaced or deleted from captions but not filenames.
- Example:
- If you have the word
deleteword
in the caption, you can configure it in the replacement list like:'deleteword' '<space>'
.
- This will replace
deleteword
with an empty space in the caption.
- If you have the word
- If you want to delete words from captions, you should use the replacement method, where the word will be replaced with a space (
3. More About the /token
Method
- How to use:
- After configuring the AD_API and WEBSITE_URL in the
config.py
file, use the/token
command to generate short links. - This allows you to generate monetized links for users, where you can set up a link shortener (e.g., UpShrink, AdFly) and monetize the botโs links.
- After configuring the AD_API and WEBSITE_URL in the
- Why use it: This is helpful for people who want to earn revenue from the links processed by the bot. It's fully configurable, and you can integrate it with any supported short link provider.
4. Other Fixes and Improvements
- Improved handling for batch processes: The bot now handles batch processes more effectively and allows users to process multiple links at once.
- Bug fixes: Several minor bugs related to session management and batch cancellations have been addressed, ensuring a smoother user experience.
โ๏ธ How to Configure</summary
-
Set up
STRING
for 4GB Upload:- If you want to upload large files (up to 4GB), make sure to add your premium session string(PYROGRAM V2) in the
STRING
variable inconfig.py
. This is optional and only needed for premium owner who want to allow 4GB upload.
- If you want to upload large files (up to 4GB), make sure to add your premium session string(PYROGRAM V2) in the
-
Set up
AD_API
andWEBSITE_URL
for Monetization:- To use the link shortener service for monetization, collect the API key and website URL from your shortener provider (e.g., UpShrink, AdFly) and add them to the
AD_API
andWEBSITE_URL
variables inconfig.py
.
- To use the link shortener service for monetization, collect the API key and website URL from your shortener provider (e.g., UpShrink, AdFly) and add them to the
-
Delete Word Configuration:
- If you wish to configure words to be deleted from filenames, list them in the delete word list.
- For captions, use the replacement method where words will be replaced with
<space>
.
Update: 21 NOV 2024
- Public Channels: Removed login requirement for processing links from public channels.
- Batch Size Limits: New variables
FREEMIUM_LIMIT
andPREMIUM_LIMIT
to manage batch sizes based on user type. - Important Note: Set
FREEMIUM_LIMIT
to0
to restrict link extraction.
Update: 20 NOV 2024
- Batch Processing: Prevents overlapping batch processes.
- UserBot Management: Safely stops
userbot
after all processes. - Bug Fixes: Fixed issues with
userbot
stopping and overlapping processes.
Update: 16 NOV 2024
- Fixed issues with
.MOV
file handling and file renaming. - Improved caption formatting.
Update: 15 NOV 2024
- Fixed reset button.
- Added support for topic-based groups.
Update: 16 AUG 2024
- Added
/logout
command to clear session data. - Fixed premium membership expiration.
Update: 7 JULY 2024
- Introduced
/login
via phone number. - Added auto-pinning of messages and other improvements.
Visit the Terms of Use page to review and accept the guidelines.
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!
My group members contact... Join @save_restricted_content_bots to know them.
Thanks!