https://github.com/cccaaannn/telegram_youtube_downloader
Telegram bot for downloading video or audio from multiple sites.
https://github.com/cccaaannn/telegram_youtube_downloader
bot facebook-video-downloader instagram-video-downloader python telegram-bot twitter-video-downloader youtube-dl youtube-music-downloader youtube-video-downloader yt-dlp
Last synced: 2 months ago
JSON representation
Telegram bot for downloading video or audio from multiple sites.
- Host: GitHub
- URL: https://github.com/cccaaannn/telegram_youtube_downloader
- Owner: cccaaannn
- License: mit
- Created: 2020-09-14T23:03:07.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-23T16:53:52.000Z (3 months ago)
- Last Synced: 2025-03-23T17:34:18.243Z (3 months ago)
- Topics: bot, facebook-video-downloader, instagram-video-downloader, python, telegram-bot, twitter-video-downloader, youtube-dl, youtube-music-downloader, youtube-video-downloader, yt-dlp
- Language: Python
- Homepage: https://t.me/cccaaannnYoutubeDownloaderBot
- Size: 102 KB
- Stars: 81
- Watchers: 3
- Forks: 39
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Telegram YouTube downloader
---
## Telegram bot for downloading video or audio from [multiple](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md) sites, you can run it with [single](#running) command. [](https://github.com/cccaaannn/telegram_youtube_downloader/releases?style=flat-square) [](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/LICENSE) [](https://hub.docker.com/r/cccaaannn/telegram_youtube_downloader) [](https://hub.docker.com/r/cccaaannn/telegram_youtube_downloader)
## Overview
- [Demo](#demo)
- [Commands](#commands)
- [Running and examples](#running)
- [Docs](#docs)## Demo
![]()
## Commands
⏬ Download commands
```shell
/video
/video
/v
``````shell
/audio
/audio
/a
```🔎 Search command
Performs a YouTube search to download. [See setup/search](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/docs/SETUP.md#search-command)
```shell
/search
/s
```⚙️ Utility commands
[See configurations](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/docs/CONFIGURATIONS.md) for command configurations.
```shell
/formats
/sites
/help
/about
```## Running
🚀 Simple usage with Docker. (To run without docker [see setup](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/docs/SETUP.md))
```shell
docker run -d --name telegram_youtube_downloader --restart unless-stopped -e TELEGRAM_BOT_KEY= cccaaannn/telegram_youtube_downloader:latest
```🏠 Example with default command
You can set a [default command](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/docs/CONFIGURATIONS.md#default_command) to run a download command on bare messages.
```shell
docker run -d --name telegram_youtube_downloader --restart unless-stopped \
-e TELEGRAM_BOT_KEY= \
-e telegram_bot_options__default_command=video \
cccaaannn/telegram_youtube_downloader:latest
```🔑 Example with authorization
You can set authorization rules per user [see authorization config](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/docs/CONFIGURATIONS.md#authorization_options).
If you have many users you can map the configs directory to a local directory and edit the config file.```shell
docker run -d --name telegram_youtube_downloader --restart unless-stopped \
-e TELEGRAM_BOT_KEY= \
-e telegram_bot_options__authorization_options__mode=ALLOW_SELECTED \
-e telegram_bot_options__authorization_options__users__0__claims=all \
-e telegram_bot_options__authorization_options__users__0__id= \
-e telegram_bot_options__authorization_options__users__1__claims=audio,help \
-e telegram_bot_options__authorization_options__users__1__id= \
cccaaannn/telegram_youtube_downloader:latest
```💾 Example with mapped volumes
1. You can map logs to a local directory. [See logger options](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/docs/CONFIGURATIONS.md#logger_options).
2. You can also map the configs directory to a local directory if you have too many custom configurations.```shell
docker run -d --name telegram_youtube_downloader --restart unless-stopped \
-e TELEGRAM_BOT_KEY= \
-v /logs:/app/logs \
-v /configs:/app/telegram_youtube_downloader/configs \
cccaaannn/telegram_youtube_downloader:latest
```🔎 Example with search
You can use search command to search videos on YouTube. [See search feature](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/docs/SETUP.md#search-command).
```shell
docker run -d --name telegram_youtube_downloader --restart unless-stopped \
-e TELEGRAM_BOT_KEY= \
-e YOUTUBE_API_KEY= \
cccaaannn/telegram_youtube_downloader:latest
```🍪 Example with cookie file
You can use a [cookie file](https://github.com/yt-dlp/yt-dlp/wiki/Extractors#exporting-youtube-cookies) to download without getting blocked.
```shell
docker run -d --name telegram_youtube_downloader --restart unless-stopped \
-e TELEGRAM_BOT_KEY= \
-e youtube_downloader_options__audio_options__cookiefile=/app/cookies/cookies.txt \
-e youtube_downloader_options__video_options__cookiefile=/app/cookies/cookies.txt \
-v /cookies:/app/cookies \
cccaaannn/telegram_youtube_downloader:latest
```🪪 Example with PO token
You can use [visitor data and PO token](https://github.com/yt-dlp/yt-dlp/wiki/Extractors#passing-visitor-data-without-cookies) on downloads to bypass blocking on some sites.
- You can use [YouTube trusted session generator](https://github.com/iv-org/youtube-trusted-session-generator) project to get PO token and visitor data for YouTube.```shell
docker run -d --name telegram_youtube_downloader --restart unless-stopped \
-e TELEGRAM_BOT_KEY= \
-e youtube_downloader_options__audio_options__extractor_args='"youtubetab:skip=webpage;youtube:player_skip=webpage,configs;visitor_data=;youtube:po_token=web.gvs+"' \
-e youtube_downloader_options__video_options__extractor_args='"youtubetab:skip=webpage;youtube:player_skip=webpage,configs;visitor_data=;youtube:po_token=web.gvs+"' \
cccaaannn/telegram_youtube_downloader:latest
```🐳 Example with compose
You can use docker compose to run. [See docker compose](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/docs/SETUP.md#2-docker-compose).
- Copy `compose/.env.template` to `compose/.env`, add your `TELEGRAM_BOT_KEY`
```shell
docker compose -f compose/default.yaml up -d
```🏗️ Example with terraform
You can use terraform to deploy the bot. [See setup/terraform](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/docs/SETUP.md#3-terraform)
```shell
cd terraform/aws
terraform init
terraform apply
```## Daily build
This project depends on [yt-dlp](https://github.com/yt-dlp/yt-dlp) and it is constantly updated, a [daily Docker build](https://hub.docker.com/r/cccaaannn/telegram_youtube_downloader/tags) pipeline added to keep the project up to date with external dependencies. It is not tested so might not be stable but if you are getting download errors on the latest version you can use daily until latest is fixed.
```shell
docker run -d --name telegram_youtube_downloader --restart unless-stopped -e TELEGRAM_BOT_KEY= cccaaannn/telegram_youtube_downloader:daily
```## Docs
- [Setup](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/docs/SETUP.md) for more ways to run the bot.
- [Configurations](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/docs/CONFIGURATIONS.md) for all configurable options.
- [Hardware Acceleration](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/docs/HARDWARE_ACCELERATION.md) for using ffmpeg with hardware acceleration.
- [Api Server](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/docs/API_SERVER.md) for using with custom telegram api server with increased download limits.