ytdlbot/README.md

140 lines
2.9 KiB
Markdown
Raw Normal View History

2021-08-29 02:19:49 +00:00
# ytdlbot
2021-08-30 14:06:32 +00:00
YouTube Download Bot🚀
2021-08-29 02:19:49 +00:00
2021-05-04 04:01:53 +00:00
Download videos from YouTube and other platforms through a Telegram Bot
2021-05-23 14:25:15 +00:00
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
2021-05-04 04:01:53 +00:00
2021-08-29 02:19:49 +00:00
# Usage
2021-05-04 04:01:53 +00:00
[https://t.me/benny_ytdlbot](https://t.me/benny_ytdlbot)
2021-08-29 02:19:49 +00:00
Send link directly to the bot. Any
platform [supported by youtube-dl](https://ytdl-org.github.io/youtube-dl/supportedsites.html) will also work.
2021-05-04 04:01:53 +00:00
2021-08-29 02:19:49 +00:00
## Limitation of my bot
Because I have limited resources, hundreds of Gigabytes doesn't sound like a sustainable solution.
2021-10-30 06:27:43 +00:00
**In that case, I added one limitation: 5 GiB per 24 hours for each user. Might change in future**
2021-08-29 02:19:49 +00:00
You can choose to become 'VIP' if you really need large traffic. And also, you could always deploy your own bot.
# Features
![](assets/1.jpeg)
2021-08-29 02:19:49 +00:00
1. fast download and upload.
2. ads free
3. support progress bar
4. audio conversion
5. playlist support
6. VIP support
7. support different video resolutions
8. support sending as file or streaming as video
![](assets/2.png)
2021-05-04 05:36:28 +00:00
# How to deploy?
2021-08-29 02:19:49 +00:00
You can deploy this bot on any platform that supports Python.
2021-08-30 14:42:54 +00:00
## Heroku
Use the button above! It should work like a magic.
2021-05-04 05:36:28 +00:00
## Normal
2021-08-29 02:19:49 +00:00
1. clone code
2. install ffmpeg
2021-05-05 06:10:08 +00:00
3. install Python 3.6+
4. pip3 install -r requirements.txt
2021-08-29 02:19:49 +00:00
5. set environment variables `TOKEN`, `APP_ID` and `APP_HASH`, and more if you like.
6. `python3 ytdl.py`
2021-08-30 14:42:54 +00:00
## Simple one line docker
Some functions, such as VIP, ping will be disabled.
```shell
docker run -e APP_ID=111 -e APP_HASH=111 -e TOKEN=370FXI bennythink/ytdlbot
```
## docker-compose
2021-08-29 02:19:49 +00:00
Compatible with amd64, arm64 and armv7l
### 1. get docker-compose.yml
Download this file to a directory, for example `~/ytdl/docker-compose.yml`
### 2. create VIP database
```shell
mkdir ~/ytdl/data/
touch ~/ytdl/data/vip.sqlite
```
### 3. create env file
```shell
mkdir ~/ytdl/env/
vim ~/ytdl/env/ytdl.env
```
you can configure all the following environment variables:
2021-10-30 06:27:43 +00:00
* WORKERS: default 500
2021-08-29 02:19:49 +00:00
* APP_ID: **REQUIRED**
* APP_HASH: **REQUIRED**
* TOKEN: **REQUIRED**
* REDIS: **REQUIRED**
2021-10-30 06:27:43 +00:00
2021-08-29 02:19:49 +00:00
* OWNER: owner username
* QUOTA: quota in bytes
* EX: quota expire time
* MULTIPLY: vip quota comparing to normal quota
* USD2CNY: exchange rate
* VIP: enable VIP or not, default: disable
* AFD_LINK
* COFFEE_LINK
* COFFEE_TOKEN
* AFD_TOKEN
* AFD_USER_ID
2021-10-30 06:27:43 +00:00
* AUTHORIZED_USER: users that could use this bot, user_id, separated with `,`
* REQUIRED_MEMBERSHIP: group or channel username, user must join this group to use the bot. Could be use with
above `AUTHORIZED_USER`
2021-08-29 02:19:49 +00:00
### 4. run
```
docker-compose up -d
```
2021-05-04 04:01:53 +00:00
2021-05-05 06:10:08 +00:00
# Command
2021-08-29 02:19:49 +00:00
```
2021-08-16 11:45:36 +00:00
start - Let's start
about - Want to contribute?
ping - Bot running status
2021-08-25 14:13:25 +00:00
help - Anything troubles you?
2021-08-16 11:45:36 +00:00
ytdl - Download video in group
vip - Join VIP
terms - View Terms of Service
settings - Set your preference
```
2021-05-05 06:10:08 +00:00
# Test video
2021-08-29 02:19:49 +00:00
2021-05-05 06:10:08 +00:00
https://www.youtube.com/watch?v=BaW_jenozKc
# Test Playlist
2021-08-29 02:19:49 +00:00
https://www.youtube.com/playlist?list=PL1Hdq7xjQCJxQnGc05gS4wzHWccvEJy0w
2021-05-04 04:01:53 +00:00
# License
2021-08-29 02:19:49 +00:00
2021-05-04 04:01:53 +00:00
Apache License 2.0