Bot for downloading files via links in tg
Find a file
github-actions[bot] 9adec2ea97 [u] update yt-dlp
2025-11-12 20:27:03 +00:00
.github/workflows [u] 23h MSK 2025-06-10 10:37:32 +03:00
bot [f] correct video size 2025-08-19 23:45:45 +03:00
.gitignore [+] add gitignore 2024-10-15 22:13:49 +03:00
dockerfile [f] fix db path 2025-04-09 21:43:27 +03:00
pyproject.toml [u] ytdlp update 2025-05-23 17:29:59 +03:00
readme.md [r] rename 2025-08-02 20:57:14 +03:00
uv.lock [u] update yt-dlp 2025-11-12 20:27:03 +00:00

downloader_tg_py

This project is a YouTube downloader bot for Telegram. It allows users to download videos or audio from YouTube, manage their subscribed channels, and receive notifications and downloads about new videos.

Initial Setup

  1. Clone the repository: Clone this repository using git clone.
  2. Create Virtual Env: Create a Python Virtual Environment venv to download the required dependencies and libraries.
  3. Download Dependencies: Download the required dependencies into the Virtual Environment venv using uv.
git clone https://github.com/ergolyam/downloader_tg_py.git
cd downloader_tg_py
python -m venv .venv
.venv/bin/python -m pip install uv
.venv/bin/python -m uv sync

Usage

Deploy

  • Run the bot:
    TG_TOKEN="telegram_bot_token" .venv/bin/python bot
    

Container

  • Pull the container:

    podman pull ghcr.io/ergolyam/downloader_tg_py:latest
    
  • Deploy using Podman:

    mkdir -p $HOME/database/ && \
    podman run --tmpfs /tmp \
    --name downloader_tg_py \
    -v $HOME/database/:/app/database/:z \
    -e TG_TOKEN="your_telegram_bot_token" \
    ghcr.io/ergolyam/downloader_tg_py:latest
    

Environment Variables

The following environment variables control the startup of the project:

Variable Values Description
LOG_LEVEL DEBUG, INFO, WARNING, ERROR Logging verbosity
TG_ID integer Telegram API ID from my.telegram.org
TG_HASH string Telegram API hash
TG_TOKEN string Bot token issued by @BotFather
DB_PATH string Path to SQLite database file (default data.db)
COOKIE_PATH string Path to cookie storage file (default cookie.txt)
HTTP_PROXY URL HTTP proxy in the form http://user:password@host:port

Features

  • Download Videos: Users can download YouTube videos in various qualities.
  • Channel Subscription: Users can subscribe to YouTube channels and receive notifications and downloads when new videos are uploaded.
  • SponsorBlock Integration: Automatically reads sponsored segments in downloaded videos.
  • Customizable: Configure log level, http proxy, and more through environment variables. Also configuration of notifications about new videos the user has.