Skip to content

yellowgg2/youngs-ytdl

Repository files navigation

한글

youtube-dl download telegram bot

You can install this bot where Docker can be installed.

This bot is working with ydls.

I modified ydls original code to add Channel name and Upload date to filename, so I had to include ydls code to this repo as submodule.

Features

  • Mainly download Youtube and other sites that are supported by ydls (ex: twitter)

    • Supported Sites

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

    • To download youtube, just send url to the bot and choose the format which you would like to download with

    • As soon as you choose a format, it will start downloading

    • Once downloading is completed, it will send back complete message.

    • It will automatically download youtube without choosing a format if you set default file types with setft (multiple formats can be chosen)

      drawing
  • Download Playlist

    • Bot will recognize URL as a playlist if it starts with https://www.youtube.com/playlist?list, then starts download all videos in the list
    • Playlist URL MUST be public one
    • If you would like to stop downloading Playlist while it's still downloading, then send one of these words (정지, 멈춤, s, stop)
  • User and Admin can be added separately

    • Modify TELEGRAM_ADMIN_USERNAME in.env to add Admin
    • User can be added by Admin, while operating, with telegram command
  • User Menu

    • User means the one who is registered by Admin

    • help: Show help menu

    • allusers: Show all users registered

    • setft: Set default file types. If do so, it won't ask file type to be downloaded. (Default file types can be cleared with choosing none)

    • showft: Show default file types that User have made with setft

      drawing
  • Admin Menu

    • Admin is the one who can manage Users

    • ahelp: Show admin help menu

    • adduser: Add User, or Admin

    • upuser: Update User or Admin info, especially description or user type

    • deluser: Delete User

    • chtof: Add channel to the filename that will be download (Toggled if executed the cmd again. This will be applied to all users current and future users registered)

    • udtof: Add Upload Date to the filename that will be download (Toggled if executed the cmd again. This will be applied to all users current and future users registered)

      drawing
  • Delete file downloaded accidentally

    • To delete file from the download directory, reply to download completed message with one of the words below.

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

      drawing

environments

.env variables you need to set before installing it

key desc example
PUID host UID (Check with id -u) 1000
GUID host GID (Check with id -g) 1000
TELEGRAM_BOT_API_TOKEN Bot Api Token. This can be optained with Bot Father in Telegram
TELEGRAM_ADMIN_USERNAME Telegram Id for Admin.If your telegram ID is @superman, then put superman without @ superman
TELEGRAM_ADMIN_DESC Admin User Description SuperMan
TELEGRAM_ADMIN_CHATID Telegram Chat id for Admin to receive message with once error occurs 11223344
DOWNLOAD_PATH Download location in host machine ./bot/download
BOT_LANG Set language (ko: Korean, en: English) ko or en

Installation

Basically you MUST install docker, docker-compose.

  • Clone repo recursively with git clone --recurse-submodules https://github.com/yellowgg2/youngs-ytdl
  • Modify .env file as you wish
  • If you are using Synology and want to make it work with DS audio especially
    • You need to create a scheduler as boot script in control panel of Synology that executes download-watch.sh included in this repo for Synology to start indexing once download completed. (You MUST change DOWNLOAD_PATH in download-watch.sh to what DS audio watching)
    • You won't be able to see the file downloaded in DS audio if you don't do so
  • Run docker-compose up -d --build finally

Update

Executes the below commands sequentially

  • git pull --recurse-submodules
  • docker-compose down && docker-compose up -d --build