Last active
September 11, 2018 16:20
-
-
Save czj/6b8a091f3ead27826ae71f621a9d61d2 to your computer and use it in GitHub Desktop.
Download any YouTube video, channel or playlist using youtube-dl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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