https://github.com/dhhiep/youtube-dl-docker
881
Download with youtube-dl using command line arguments or configuration files
-e AUTOUPDATE=yesdownloads/log.txt if -e LOG=yeshttps://duckduckgo.com with wget every 10 minutesdocker pull hoanghiepitvnn/youtube-dl-aiodocker-compose up --build
docker push hoanghiepitvnn/youtube-dl-aio
1. Add alias commands below to ~/.bashrc or ~/.zshrc
YOUTUBE_DOWNLOAD_PATHexport YOUTUBE_DOWNLOAD_PATH=/Users/hiepdinh/Data/Youtube
alias yt_files="open $YOUTUBE_DOWNLOAD_PATH"
alias yt_log="tail -f $YOUTUBE_DOWNLOAD_PATH/log.txt"
alias ytdl_base="docker run --rm --name=youtube-dl -e AUTOUPDATE=yes -v $YOUTUBE_DOWNLOAD_PATH:/downloads:rw hoanghiepitvnn/youtube-dl-aio"
alias yt_audio="ytdl_base -x --audio-format mp3 --audio-quality 0 --ignore-errors"
alias yt_video="ytdl_base -f 'bestvideo[height>=1000+height<1100]+bestaudio/bestvideo[ext=mp4]' --recode-video mp4 --postprocessor-args '-vcodec copy'"
alias yt_video2k="ytdl_base -f 'bestvideo[height>=1400+height<1500]+bestaudio/bestvideo[ext=mp4]' --recode-video mp4 --postprocessor-args '-vcodec copy'"
alias yt="yt_audio -o '/downloads/%(title)s.%(ext)s'"
alias ytl="yt_audio -o '/downloads/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s'"
alias ytv="yt_video -o '/downloads/%(title)s.%(ext)s'"
alias ytv2k="yt_video2k -o '/downloads/%(title)s.%(ext)s'"
alias ytvl="yt_video -o '/downloads/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s'"
alias ytv2kl="yt_video2k -o '/downloads/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s'"
2. Usage
| Command | Description |
|---|---|
| yt_files | Open folder contain files downloaded |
| yt_log | Tail container log |
| yt | Download audio at best quality. |
| ytl | Download playlist audio at best quality. |
| ytv | Download video max resolution at 1080 quality |
| ytvl | Download playlist video max resolution at 1080 quality |
| ytv2k | Download video max resolution at 2K quality |
| ytvl2k | Download playlist video max resolution at 2K quality |
Example:
yt https://www.youtube.com/watch?v=Ex8IeflzftY
ytl https://www.youtube.com/watch?v=d--UOXdbtuE&list=PLbnOcTug_qTzM9-08LJddoirbpYX18zq0
ytv https://www.youtube.com/watch?v=Ex8IeflzftY
ytvl https://www.youtube.com/watch?v=d--UOXdbtuE&list=PLbnOcTug_qTzM9-08LJddoirbpYX18zq0
ytv2k https://www.youtube.com/watch?v=Ex8IeflzftY
ytvl2k https://www.youtube.com/watch?v=d--UOXdbtuE&list=PLbnOcTug_qTzM9-08LJddoirbpYX18zq0
| Environment variable | Default | Description |
|---|---|---|
LOG | yes | Writes youtube-dl output to /downloads/log.txt or not |
AUTOUPDATE | no | Updates youtube-dl to the latest version at launch |
GOTIFYURL | Gotify server URL address (i.e. http://192.168.1.5:8000 or https://a.com/gotify) | |
GOTIFYTOKEN | Gotify server Token |
You can either:
Change the ownership and permissions of ./downloads on your host with:
chown 1000 -R ./downloads
chmod 700 ./downloads
chmod -R 600 ./downloads/*
Launch the container with a different user using --user=$UID:$GID
Content type
Image
Digest
Size
41.5 MB
Last updated
almost 6 years ago
docker pull hoanghiepitvnn/youtube-dl-aio