By default downloads runs in vanopiano/download_ytdl:latest
which can be changed with DOCKER_IMAGE
variable:
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 asDOCKER_MOUNT_PATH
inside download docker image (DOCKER_IMAGE
)
.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
- Fill .env from .env.sample with your bot token and user
- Run
bundle install
bundle exec bot.rb