Skip to content

Instantly share code, notes, and snippets.

@parinck
Created March 27, 2016 13:56
Show Gist options
  • Save parinck/4f4fd2b6f6137ec80410 to your computer and use it in GitHub Desktop.
Save parinck/4f4fd2b6f6137ec80410 to your computer and use it in GitHub Desktop.
Download youtube videos from Terminal
#!/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
@parinck
Copy link
Author

parinck commented Mar 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment