diff --git a/Dockerfile b/Dockerfile index c85e507..ba7a7ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,17 @@ ENV DEBIAN_FRONTEND noninteractive ENV HOME /root RUN apt update && apt -y upgrade +RUN apt install -y python3-pip ffmpeg locales +RUN echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen && locale-gen && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 -RUN apt install -y python3-pip +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 RUN pip3 install youtube_dl +ADD youtube-dl.conf /etc/youtube-dl.conf +ADD entrypoint.sh /usr/local/bin/entrypoint.sh -ADD youtube-dl.conf /root/.config/youtube-dl/config +USER nobody:nogroup +WORKDIR /tmp +CMD /bin/bash /usr/local/bin/entrypoint.sh diff --git a/README.md b/README.md index 3d8c04f..6adcb14 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,11 @@ inspired by https://old.reddit.com/r/DataHoarder/comments/c6fh4x/after_hoarding_over_50k_youtube_videos_here_is/ +# usage + +``` +docker run \ + -v /storage/scratch/youtube:/output \ + -e DOWNLOAD_URL=https://www.youtube.com/channel/UCsXVk37bltHxD1rDPwtNM8Q/videos \ + sneak/youtube-dl +``` diff --git a/bin/download-interesting-channels b/bin/download-interesting-channels new file mode 100755 index 0000000..8a3e399 --- /dev/null +++ b/bin/download-interesting-channels @@ -0,0 +1,32 @@ +#!/bin/bash + +DEST="/storage/scratch/youtube" + +CHANNELS="" + +CHANNELS+=" https://www.youtube.com/channel/UCm9K6rby98W8JigLoZOh6FQ/videos" # the lockpicking lawyer +CHANNELS+=" https://www.youtube.com/user/DeviantOllam/videos" # deviant ollam +CHANNELS+=" https://www.youtube.com/user/Vsauce/videos" # vsauce, michael here +CHANNELS+=" https://www.youtube.com/user/featony/videos" # this old tony +CHANNELS+=" https://www.youtube.com/channel/UCworsKCR-Sx6R6-BnIjS2MA/videos" # clickspring +CHANNELS+=" https://www.youtube.com/user/arduinoversusevil/videos" # AvE +CHANNELS+=" https://www.youtube.com/user/Abom79/videos" # Abom79 +CHANNELS+=" https://www.youtube.com/user/saunixcomp/videos" # NYC CNC + +CHANNELS+=" https://www.youtube.com/channel/UCZaDAUF7UEcRXIFvGZu3O9Q/videos" # dirtyUSMLE +CHANNELS+=" https://www.youtube.com/channel/UC-i2EBYXH6-GAglvuDIaufQ/videos" # Speedy Pharmacology +CHANNELS+=" https://www.youtube.com/channel/UC_yjveGdyx6mqqHkHaD-_bg/videos" # Larry Mellick +CHANNELS+=" https://www.youtube.com/channel/UC54htze_JB0zz9H6oAbMOJQ/videos" # Medskl +CHANNELS+=" https://www.youtube.com/channel/UCXAfmcfOeS0rxDz6sp0cYYg/videos" # AANS Neurosurgery +CHANNELS+=" https://www.youtube.com/channel/UC85VW73bQLEjs_taFKP7TwQ/videos" # Nucleus Medical Media +CHANNELS+=" https://www.youtube.com/channel/UC9RM-iSvTu1uPJb8X5yp3EQ/videos" # Wendover +CHANNELS+=" https://www.youtube.com/channel/UCHnyfMqiRRG1u-2MsSQLbXA/videos" # Veritasium +CHANNELS+=" https://www.youtube.com/channel/UCsXVk37bltHxD1rDPwtNM8Q/videos" # Kurzgesagt +CHANNELS+=" https://www.youtube.com/channel/UC88tlMjiS7kf8uhPWyBTn_A/videos" # captain joe + +for CHANNEL in $CHANNELS; do + docker run \ + -v $DEST:/output \ + -e DOWNLOAD_URL="$CHANNEL" \ + sneak/youtube-dl +done diff --git a/bin/ytdl b/bin/ytdl new file mode 100755 index 0000000..80f7f28 --- /dev/null +++ b/bin/ytdl @@ -0,0 +1,5 @@ +#!/bin/bash +docker run \ + -v /storage/scratch/youtube:/output \ + -e DOWNLOAD_URL="$1" \ + sneak/youtube-dl diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..fbfc126 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +umask 0000 +youtube-dl --config-location /etc/youtube-dl.conf "$DOWNLOAD_URL" diff --git a/youtube-dl.conf b/youtube-dl.conf index 2307856..1344ef8 100644 --- a/youtube-dl.conf +++ b/youtube-dl.conf @@ -7,4 +7,4 @@ --match-filter "playlist_title != 'Liked videos' & playlist_title != 'Favorites'" -f "(bestvideo[vcodec^=av01][height>=1080][fps>30]/bestvideo[vcodec=vp9.2][height>=1080][fps>30]/bestvideo[vcodec=vp9][height>=1080][fps>30]/bestvideo[vcodec^=av01][height>=1080]/bestvideo[vcodec=vp9.2][height>=1080]/bestvideo[vcodec=vp9][height>=1080]/bestvideo[height>=1080]/bestvideo[vcodec^=av01][height>=720][fps>30]/bestvideo[vcodec=vp9.2][height>=720][fps>30]/bestvideo[vcodec=vp9][height>=720][fps>30]/bestvideo[vcodec^=av01][height>=720]/bestvideo[vcodec=vp9.2][height>=720]/bestvideo[vcodec=vp9][height>=720]/bestvideo[height>=720]/bestvideo)+(bestaudio[acodec=opus]/bestaudio)/best" --merge-output-format mkv --o "/output/%%(playlist_uploader)s/%%(playlist)s/%%(playlist_index)s - %%(title)s - %%(id)s.%%(ext)s" +-o "/output/%(playlist_uploader)s/%(playlist)s/%(playlist_index)s - %(title)s - %(id)s.%(ext)s"