Last active
November 28, 2016 22:07
-
-
Save Madh93/6d5e6267ab41f9e4c6e60c691641cb8f to your computer and use it in GitHub Desktop.
Get 1080p Youtube videos (or best available 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 | |
# Requirements: youtube-dl (https://github.com/rg3/youtube-dl/) | |
if [ -n "$(youtube-dl --version)" ]; then | |
format=`youtube-dl -F "$1"` | |
if [ -n "$(echo "$format" | cut -d " " -f1 | grep 299)" ]; then | |
youtube-dl -f 299+140 "$1" | |
elif [ -n "$(echo "$format" | cut -d " " -f1 | grep 298)" ]; then | |
youtube-dl -f 298+140 "$1" | |
elif [ -n "$(echo "$format" | cut -d " " -f1 | grep 137)" ]; then | |
youtube-dl -f 137+140 "$1" | |
else | |
youtube-dl -f best "$1" | |
fi | |
else | |
echo "youtube-dl not found" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment