selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
telethon_downloader logo

Self-host telethon_downloader

v3.1.9

Telegram bot for auto media downloads with YouTube & torrent

ReleaseOpen SourceGPL-3.0
Updated3 years ago
LanguagePython
Setup difficultyModerate
Stars
206
Docker
jsavargas/telethon_downloader
Install with Docker Compose
Bot interface showing automatic download in actionYouTube download options interface

What is telethon_downloader?

Telethon Downloader is a self-hosted Telegram bot that automatically saves multimedia files sent to it. Built on the Telethon library, it handles media from Telegram messages, downloads videos and audio from YouTube links, and processes .torrent files by sending them to qBittorrent or a watch folder. Files are organized into folders based on extension, group or channel ID, keywords, or regex patterns configured via config.ini or bot commands. The bot provides interactive commands for renaming files, setting download paths, and browsing directories. It runs as a Docker container with configurable environment variables for Telegram API credentials, download limits, YouTube format preferences, and torrent client settings. All interaction happens through Telegram chat — there is no web UI.

Should you self-host telethon_downloader?

telethon_downloader scores 45/100 on selfhost.directory (how scoring works) and ranks #34 of 45 in Download Management. It has 206 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is GPL-3.0-licensed and written mostly in Python.

Its closest alternative on selfhost.directory is cobalt (83/100, 45 589 stars). It scores higher overall, so compare the two before you pick. See telethon_downloader vs cobalt side by side.

Features

  • Automatic media downloads
  • Directory Browser
  • Direct URL file download
  • Download progress tracking
  • File organization by extension
  • File organization by group/channel
  • File organization by keywords
  • File organization by regex patterns
  • Interactive file rename
  • Interactive path configuration
  • Quick extension path setting
  • Quick group path setting
  • Torrent support via watch folder
  • YouTube video and audio download

telethon_downloader README

How to install telethon_downloader

Install telethon_downloader with Docker Compose

Docker Engine and Docker Compose
Environment variables
All environment variables from Docker platform plus TORRENT_MODE, QBT_HOST, QBT_PORT, QBT_USERNAME, QBT_PASSWORD, YOUTUBE_AUDIO_FOLDER, YOUTUBE_VIDEO_FOLDER

version: '3'

services:

telethon_downloader: image: jsavargas/telethon_downloader container_name: telethon_downloader restart: unless-stopped network_mode: host environment: - PUID=99 - PGID=100 - TG_AUTHORIZED_USER_ID= # - TG_API_ID= - TG_API_HASH= - TG_BOT_TOKEN= - TZ=America/Santiago - TG_MAX_PARALLEL=3 # OPTIONAL - TG_DL_TIMEOUT=4600 # OPTIONAL - TG_PROGRESS_DOWNLOAD=True # OPTIONAL (True/False) - PROGRESS_STATUS_SHOW=10 # OPTIONAL (10) - YOUTUBE_FORMAT_AUDIO=bestaudio/best # OPTIONAL (bestaudio/best) - YOUTUBE_FORMAT_VIDEO=bestvideo+bestaudio/best # OPTIONAL (bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best) - YOUTUBE_DEFAULT_DOWNLOAD=VIDEO # OPTIONAL (AUDIO/VIDEO) - YOUTUBE_DEFAULT_EXTENSION=MKV # OPTIONAL (mkv/mp4) - YOUTUBE_SHOW_OPTION=True # OPTIONAL (True/False) - YOUTUBE_TIMEOUT_OPTION=5 # OPTIONAL (5) - YOUTUBE_AUDIO_FOLDER=/youtube/audio # OPTIONAL - YOUTUBE_VIDEO_FOLDER=/youtube/video # OPTIONAL - TORRENT_MODE=qbittorrent # OPTIONAL (watch/qbittorrent)
- QBT_HOST=192.168.1.10 # OPTIONAL
- QBT_PORT=8080 # OPTIONAL - QBT_USERNAME=admin # OPTIONAL - QBT_PASSWORD=adminadmin # OPTIONAL volumes: - /path/to/config:/config - /path/to/download:/download - /path/to/watch:/watch - /path/to/youtube:/youtube

Full docker-compose example with all optional environment variables shown

How to configure telethon_downloader

  • PERMISSIONS_FILE755File permissions

    File permissions

  • PERMISSIONS_FOLDER777Folder permissions

    Folder permissions

  • PGIDGroup ID for file permissions

    Group ID for file permissions

  • PROGRESS_STATUS_SHOW10Show download progress every N percent

    Show download progress every N percent

  • PUIDUser ID for file permissions

    User ID for file permissions

  • QBT_HOSTHostname or IP address of the qBittorrent Web UI (required if TORRENT_MODE is qbittorrent)

    Hostname or IP address of the qBittorrent Web UI (required if TORRENT_MODE is qbittorrent)

  • QBT_PASSWORDPassword for qBittorrent Web UI authentication

    Password for qBittorrent Web UI authentication

  • QBT_PORT8080Port of the qBittorrent Web UI

    Port of the qBittorrent Web UI

  • QBT_USERNAMEUsername for qBittorrent Web UI authentication

    Username for qBittorrent Web UI authentication

  • TG_API_HASHTelegram API hash generated at my.telegram.org

    Telegram API hash generated at my.telegram.org

  • TG_API_IDTelegram API ID generated at my.telegram.org

    Telegram API ID generated at my.telegram.org

  • TG_AUTHORIZED_USER_IDTelegram chat_id of the authorized user who can send files to the bot

    Telegram chat_id of the authorized user who can send files to the bot

  • TG_BOT_TOKENTelegram bot token from BotFather

    Telegram bot token from BotFather

  • TG_DL_TIMEOUT3600Maximum time in seconds to wait for a download to complete

    Maximum time in seconds to wait for a download to complete

  • TG_MAX_PARALLEL4Maximum number of parallel downloads allowed

    Maximum number of parallel downloads allowed

  • TG_PROGRESS_DOWNLOADTrueShow download progress

    Show download progress

    values: True, False

  • TORRENT_MODEwatchMode for torrent handling: 'qbittorrent' for qBittorrent API integration or 'watch' for watch folder

    Mode for torrent handling: 'qbittorrent' for qBittorrent API integration or 'watch' for watch folder

    values: qbittorrent, watch

  • TZSystem timezone

    System timezone

  • YOUTUBE_AUDIO_FOLDER/download/youtubeFolder where YouTube audios will be downloaded

    Folder where YouTube audios will be downloaded

  • YOUTUBE_DEFAULT_DOWNLOADVIDEOAutomatic YouTube download preference

    Automatic YouTube download preference

    values: AUDIO, VIDEO

  • YOUTUBE_DEFAULT_EXTENSIONMKVExtension format for downloading YouTube videos

    Extension format for downloading YouTube videos

    values: MKV, MP4

  • YOUTUBE_FORMAT_AUDIObestaudio/bestYouTube audio download format

    YouTube audio download format

  • YOUTUBE_FORMAT_VIDEObestvideo+bestaudio/bestYouTube video download format

    YouTube video download format

  • YOUTUBE_LINKS_SUPPORTEDyoutube.com,youtu.beYouTube links supported for downloading videos

    YouTube links supported for downloading videos

  • YOUTUBE_SHOW_OPTIONTrueShow or hide buttons to select YouTube Video or Audio download

    Show or hide buttons to select YouTube Video or Audio download

    values: True, False

  • YOUTUBE_TIMEOUT_OPTION5Time in seconds before default YouTube download option is chosen

    Time in seconds before default YouTube download option is chosen

  • YOUTUBE_VIDEO_FOLDER/download/youtubeFolder where YouTube videos will be downloaded

    Folder where YouTube videos will be downloaded

More in Download Management

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…