Skip to content

Instantly share code, notes, and snippets.

@czj
Last active September 11, 2018 16:20
Show Gist options
  • Save czj/6b8a091f3ead27826ae71f621a9d61d2 to your computer and use it in GitHub Desktop.
Save czj/6b8a091f3ead27826ae71f621a9d61d2 to your computer and use it in GitHub Desktop.
Download any YouTube video, channel or playlist using youtube-dl
#!/usr/bin/env bash
# Download a file from a given url
if [ -z "$1" ]; then
echo "Download a video."
echo "Usage: ydl \"url\""
else
youtube-dl --get-filename -o '%(title)s.%(ext)s' --restrict-filenames --yes-playlist --no-mark-watched --all-formats -f 'best[ext=mp4]/best' "$1"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment