Skip to content

Telegram bot for NAS to download youtube videos and streams

Notifications You must be signed in to change notification settings

egor-khanko/download_bot

Repository files navigation

Docker Image Docker latest version Docker Image size Docker Pulls

Telegram bot to download files with "youtube-dl"-like programs


Run in production with download in separate docker container:

By default downloads runs in vanopiano/download_ytdl:latest which can be changed with DOCKER_IMAGE variable:

Docker latest version Docker Image size Docker Pulls

Need to mount /var/run/docker.sock:/var/run/docker.sock in order to use this type of run

.env example:

BOT_TOKEN=XXXXXXX
USER_TO_SEND=XXXXXXX
YDL_OPTIONS="--video-multistreams --merge-output-format mp4"
FILE_FORMAT="%(uploader)s/%(upload_date)s.%(title)s.%(id)s.%(ext)s"
DOWNLOAD_DIR=/downloads
DOWNLOAD_IN_DOCKER=false
DOCKER_MOUNT_PATH=/downloads # default
# required, it needs to be absolute path or docker volume
DOCKER_VOLUME=download-volume
DOCKER_IMAGE=vanopiano/download_ytdl:latest # default
DEV=1
  • DOWNLOAD_DIR used as -P parameter for yt-dlp, so it can include some path inside mounted dir (DOCKER_MOUNT_PATH variable).
  • DOCKER_VOLUME - volume to mount as DOCKER_MOUNT_PATH inside download docker image (DOCKER_IMAGE)

Run in production without additional container:

.env example:

BOT_TOKEN=XXXXXXX
USER_TO_SEND=XXXXXXX
YDL_OPTIONS="--video-multistreams --merge-output-format mp4"
DOWNLOAD_DIR=./data
FILE_FORMAT="%(uploader)s/%(upload_date)s.%(title)s.%(id)s.%(ext)s"

docker-compose example

version: '3'
services:
  bot:
    image: vanopiano/download_bot:latest
    restart: on-failure
    env_file: [.env]
    volumes:
      - ./data:/app/data

Run:

  docker-compose up -d

Run in development without docker:

  1. Fill .env from .env.sample with your bot token and user
  2. Run
  bundle install
  bundle exec bot.rb

About

Telegram bot for NAS to download youtube videos and streams

Resources

Stars

Watchers

Forks

Packages

No packages published