YouTube Download Bot🚀
This Telegram bot allows you to download videos from YouTube and other supported platforms, including Instagram!
READ FAQ FIRST IF YOU ENCOUNTER ANY ISSUES.
Deploy to heroku
If you are having trouble deploying, you can fork the project to your personal account and deploy it from there.
Starting November 28, 2022, free Heroku Dynos, free Heroku Postgres, and free Heroku Data for Redis® plans will no longer be available. Heroku Announcement
Send link directly to the bot. Any Websites supported by youtube-dl will work to.
Due to limitations on servers and bandwidth, there are some restrictions on this free service.
- Each user is limited to 20 free downloads per 24-hour period
- there is a maximum of three subscriptions allowed for YouTube channels.
If you need more downloads, you can purchase additional tokens. Additionally, you have the option of deploying your own bot. See below instructions.
- fast download and upload.
- ads free
- support progress bar
- audio conversion
- playlist support
- payment support
- support different video resolutions
- support sending as file or streaming as video
- supports celery worker distribution - faster than before.
- subscriptions to YouTube Channels
- cache mechanism - download once for the same video.
- support instagram posts
This bot can be deployed on any platform that supports Python.
Need help with deployment or exclusive features? I offer paid service - contact me at @BennyThink
To deploy this bot, follow these steps:
- Clone the code from the repository.
- Install FFmpeg.
- Install Python 3.6 or a later version.
- Install Aria2 and add it to the PATH.
- Install the required packages by running
pip3 install -r requirements.txt
. - Set the environment variables
TOKEN
,APP_ID
,APP_HASH
, and any others that you may need. - Run
python3 ytdl_bot.py
.
This bot has a simple one-line code and some functions, such as VIP and ping, are disabled.
docker run -e APP_ID=111 -e APP_HASH=111 -e TOKEN=370FXI bennythink/ytdlbot
- contains every functionality
- compatible with amd64, arm64 and armv7l
Download docker-compose.yml
file to a directory
mkdir data
mkdir env
vim env/ytdl.env
You can configure all the following environment variables:
- WORKERS: workers count for celery
- PYRO_WORKERS: number of workers for pyrogram, default is 100
- APP_ID: REQUIRED, get it from https://core.telegram.org/
- APP_HASH: REQUIRED
- TOKEN: REQUIRED
- REDIS: REQUIRED if you need VIP mode and cache
⚠️ Don't publish your redis server on the internet.⚠️ - EXPIRE: token expire time, default: 1 day
- ENABLE_VIP: enable VIP mode
- OWNER: owner username
- AUTHORIZED_USER: only authorized users can use the bot
- REQUIRED_MEMBERSHIP: group or channel username, user must join this group to use the bot
- ENABLE_CELERY: celery mode, default: disable
- ENABLE_QUEUE: celery queue
- BROKER: celery broker, should be redis://redis:6379/0
- MYSQL_HOST:MySQL host
- MYSQL_USER: MySQL username
- MYSQL_PASS: MySQL password
- AUDIO_FORMAT: default audio format
- ARCHIVE_ID: forward all downloads to this group/channel
- IPv6 = os.getenv("IPv6", False)
- ENABLE_FFMPEG = os.getenv("ENABLE_FFMPEG", False)
- PROVIDER_TOKEN: stripe token on Telegram payment
- PLAYLIST_SUPPORT: download playlist support
- ENABLE_ARIA2: enable aria2c download
- FREE_DOWNLOAD: free download count per day
- TOKEN_PRICE: token price per 1 USD
- GOOGLE_API_KEY: YouTube API key, required for YouTube video subscription.
If you only need basic functionality, you can skip this step.
Required for VIP, settings, YouTube subscription.
docker-compose up -d
docker-compose exec mysql bash
mysql -u root -p
> create database ytdl;
Required if you enable celery and want to monitor the workers.
{} ~ python3
Python 3.9.9 (main, Nov 21 2021, 03:22:47)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbm;dbm.open("flower","n");exit()
You don't need to do this anymore! This bot support instagram posts out of the box, including photos, videos and reels.
In flower
service section, you may want to change your basic authentication username password and publish port.
You can also limit CPU and RAM usage by adding a `deploy' key:
deploy:
resources:
limits:
cpus: '0.5'
memory: 1500M
Be sure to use --compatibility
when deploying.
If you only want to run the mode without any celery worker and VIP mode, you can just start ytdl
service
docker-compose up -d ytdl
You'll have to start MySQL and redis to support VIP mode, subscription and settings.
docker-compose up -d mysql redis ytdl
Firstly, set ENABLE_CELERY
to true. And then, on one machine:
docker-compose up -d
On the other machine:
docker-compose -f worker.yml up -d
refer guide here kubernetes
start - Let's start
about - What's this bot?
ping - Bot running status
help - Help
ytdl - Download video in group
settings - Set your preference
buy - Buy token
direct - Download file directly
sub - Subscribe to YouTube Channel
unsub - Unsubscribe from YouTube Channel
sub_count - Check subscription status, owner only.
uncache - Delete cache for this link, owner only.
purge - Delete all tasks, owner only.
https://www.youtube.com/watch?v=BaW_jenozKc
https://www.youtube.com/playlist?list=PL1Hdq7xjQCJxQnGc05gS4wzHWccvEJy0w
https://twitter.com/nitori_sayaka/status/1526199729864200192 https://twitter.com/BennyThinks/status/1475836588542341124
https://www.instagram.com/p/ClBSqo3PkJw/
https://www.instagram.com/p/CaiAHoWDnrM/
https://www.instagram.com/p/CZtUDyyv1u1/
You can choose to donate via Stripe by clicking the button below.
Select the currency and payment method that suits you.
USD(Card, Apple Pay and Google Pay) | SEK(Card, Apple Pay and Google Pay) | CNY(Card, Apple Pay, Google Pay and Alipay) |
---|---|---|
USD | SEK | CNY |
Apache License 2.0