Skip to content

yellowgg2/youngs-ytdl

Repository files navigation

한글

YouTube Download Telegram Bot

A powerful Telegram bot for downloading videos and audio from YouTube and 1000+ other media sites. Works anywhere Docker can be installed (Linux servers, Synology NAS, etc.).

Table of Contents

Overview

This bot uses the powerful media downloader yt-dlp internally. It automatically adds channel name and upload date to downloaded filenames for better organization.

Features

Media Download

  • Supports YouTube and 1000+ other sites (Twitter, Instagram, TikTok, etc.)

  • Supported Formats: mp3, mp4, m4a, flac, ogg, wav, webm

  • Send URL to bot and choose format from interactive buttons

  • Instant download starts after format selection

  • Set default formats with setft command for automatic downloads (multiple formats supported)

    drawing

Playlist Download

  • Automatically detects URLs starting with https://www.youtube.com/playlist?list
  • Downloads all videos in the playlist sequentially
  • Note: Playlist must be public
  • Stop download anytime: send 정지, 멈춤, s, or stop

User Management System

  • Initial admin is set via TELEGRAM_ADMIN_USERNAME in .env file
  • Admins can register regular users or additional admins

User Commands

Command Description
/help Show help menu
/allusers List all registered users
/setft Set default download formats (choose none to clear)
/showft Show current default formats
/ff [search] Search downloaded files

drawing

Admin Commands

Command Description
/ahelp Show admin help menu
/adduser [ID] [Name] [Type] Add user/admin
/upuser [ID] [Name] [Type] Update user info
/deluser [ID] Delete user
/chtof Toggle channel name in filename (applies to all users)
/udtof Toggle upload date in filename (applies to all users)

drawing

File Deletion Feature

Reply to any download completed message with one of these words to delete the file:

  • 지우기, 삭제, d, del, delete

    drawing

Environment Configuration

.env file settings

Variable Description Example
PUID Host user ID (check with id -u) 1000
PGID Host group ID (check with id -g) 1000
TELEGRAM_BOT_API_TOKEN Bot token from BotFather -
TELEGRAM_ADMIN_USERNAME Admin Telegram ID (without @)
Example: @supermansuperman
superman
TELEGRAM_ADMIN_DESC Admin description SuperMan
TELEGRAM_ADMIN_CHATID Chat ID for error notifications 11223344
DOWNLOAD_PATH Download location (host path) ./bot/download
SEARCH_ROOT_PATH File search path (optional) /music
BOT_LANG Language (ko: Korean, en: English) ko

Installation

Prerequisites

  • Docker
  • Docker Compose

Installation Steps

  1. Clone Repository

    git clone https://github.com/yellowgg2/youngs-ytdl
    cd youngs-ytdl
  2. Configure Environment

    cp .env.sample .env
    # Edit .env file with your settings
  3. Start the Bot

    docker compose up -d --build

Additional Setup for Synology Users

To integrate with DS Audio:

  1. Create a scheduled task in Control Panel (triggered at startup)
  2. Add the download-watch.sh script to the task
  3. Modify DOWNLOAD_PATH in the script to match DS Audio's watch folder
    DOWNLOAD_PATH="/music"  # Path monitored by DS Audio

Usage

  1. Search for your bot in Telegram and start it
  2. Send a YouTube URL to the bot
  3. Choose desired format (or use pre-configured defaults)
  4. Wait for download completion

Update

Update yt-dlp Engine

Update to the latest yt-dlp version (for YouTube compatibility):

# Update only yt-dlp image
docker compose pull yt-dlp-service

Update Bot Code

Update to the latest bot code from repository:

# Pull latest code
git pull

# Rebuild and restart services
docker compose down
docker compose up -d --build

Full System Update

Update everything to the latest versions:

git pull
docker compose pull
docker compose down
docker compose up -d --build

Tip: If YouTube downloads start failing, updating yt-dlp usually fixes the issue.