Created
March 27, 2016 13:56
-
-
Save parinck/4f4fd2b6f6137ec80410 to your computer and use it in GitHub Desktop.
Download youtube videos from Terminal
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 | |
# tiny wrapper on top of youtube-dl | |
# check if youtube-dl exists | |
hash youtube-dl >/dev/null 2>&1 || { | |
echo "Error: youtube-dl is not installed"; | |
echo "[Install] https://rg3.github.io/youtube-dl/download.html"; | |
exit 1; | |
} | |
# chal aane de :) | |
case $1 in | |
# tu gareeb hai !! | |
240) | |
echo "Downloading video in 240......"; | |
youtube-dl -f "133+140/133+141" "$2"; | |
;; | |
360) | |
echo "Downloading video in 360......"; | |
youtube-dl -f "134+140/134+141" "$2"; | |
;; | |
480) | |
echo "Downloading video in 480......"; | |
youtube-dl -f "135+140/135+141" "$2"; | |
;; | |
# utna bhi nahi !! | |
720) | |
echo "Downloading video in 720......"; | |
youtube-dl -f "136+140/136+141" "$2"; | |
;; | |
# internet plan ki "keh ke lunga !!" | |
1080) | |
echo "Downloading video in 1080......"; | |
youtube-dl -f 22 "$2"; | |
;; | |
# abe saale QA hai kya !?! | |
*) | |
echo "YDLV Usage:" | |
echo $"$0 {240|360|480|720|1080} {url}" | |
exit 1 | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ ydlv.sh 360 https://www.youtube.com/watch?v=QoNkfOHBzQk