Created
May 16, 2021 08:15
-
-
Save pl-phan/c11ad0d9d76ef6336421ab5fae37efc6 to your computer and use it in GitHub Desktop.
Download at best quality
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
#!/bin/bash | |
if test "$1" = "video"; then | |
youtube-dl --merge-output-format mkv -o './%(upload_date)s_%(title)s.%(ext)s' $2 | |
elif test "$1" = "music"; then | |
youtube-dl -f bestaudio -x --audio-format mp3 --audio-quality 0 -o './%(upload_date)s_%(title)s.%(ext)s' $2 | |
elif test "$1" = "playlist-video"; then | |
youtube-dl --merge-output-format mkv -o './%(playlist_index)s_%(title)s.%(ext)s' $2 | |
elif test "$1" = "playlist-music"; then | |
youtube-dl -f bestaudio -x --audio-format mp3 --audio-quality 0 -o './%(playlist_index)s_%(title)s.%(ext)s' $2 | |
elif test "$1" = "formats"; then | |
youtube-dl --list-formats $2 | |
elif test ${#1} -gt 25; then | |
youtube-dl --merge-output-format mkv -o './%(upload_date)s_%(title)s.%(ext)s' $1 | |
else | |
cat ./dl.sh | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment