An open API service indexing awesome lists of open source software.

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.

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.

![GitHub top language](https://img.shields.io/github/languages/top/cccaaannn/telegram_youtube_downloader?color=blue&style=for-the-badge) [![GitHub release](https://img.shields.io/github/v/release/cccaaannn/telegram_youtube_downloader?color=blueviolet&style=for-the-badge)](https://github.com/cccaaannn/telegram_youtube_downloader/releases?style=flat-square) [![GitHub](https://img.shields.io/github/license/cccaaannn/telegram_youtube_downloader?color=brightgreen&style=for-the-badge)](https://github.com/cccaaannn/telegram_youtube_downloader/blob/master/LICENSE) [![Docker Pulls](https://img.shields.io/docker/pulls/cccaaannn/telegram_youtube_downloader?color=blue&style=for-the-badge)](https://hub.docker.com/r/cccaaannn/telegram_youtube_downloader) [![Docker Image Size (tag)](https://img.shields.io/docker/image-size/cccaaannn/telegram_youtube_downloader/latest?color=teal&style=for-the-badge)](https://hub.docker.com/r/cccaaannn/telegram_youtube_downloader)

## Overview
- [Demo](#demo)
- [Commands](#commands)
- [Running and examples](#running)
- [Docs](#docs)

## Demo
drawing drawing


## 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.