Skip to content

Instantly share code, notes, and snippets.

@flashvoid
Last active July 30, 2020 05:09
Show Gist options
  • Save flashvoid/03697ab84f9c9e56396e49c879a93403 to your computer and use it in GitHub Desktop.
Save flashvoid/03697ab84f9c9e56396e49c879a93403 to your computer and use it in GitHub Desktop.
ydl
sudo apt-get update
sudo apt-get install docker-compose
mkdir ~/youtube-dl
cd ~/youtube-dl
cat >docker-compose.yml<<EOF
version: '3'
services:
youtube-dl:
build:
context: .
working_dir: /incoming
entrypoint: /usr/bin/youtube-dl
volumes:
- "${PWD}:/incoming"
EOF
cat >Dockerfile<<EOF
FROM ubuntu:rolling
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y python3-minimal wget && \
ln -s /usr/bin/python3 /usr/bin/python && \
wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/bin/youtube-dl && \
chmod +x /usr/bin/youtube-dl
EOF
# example
# run in ~/youtube-dl directory
# docker-compose run youtube-dl "https://youtu.be/<id>"
# first run will be slow, then it will be fine
# downloaded stuff will be in ~/youtube-dl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment