Skip to content

Instantly share code, notes, and snippets.

@vijay922
Forked from MShahine/Youtubd-dl.sh
Created August 21, 2020 04:47
Show Gist options
  • Save vijay922/7a512317264dec03be603512e96a3950 to your computer and use it in GitHub Desktop.
Save vijay922/7a512317264dec03be603512e96a3950 to your computer and use it in GitHub Desktop.
This File Contain The Youtube-DL That Allows To Download Youtube Videos And The Feature Of It Is Get The Best Format And Download The File.
function ytd {
FORM=$(youtube-dl -F "$1" | grep "(best)")
DIM=$(echo $FORM | sed 's/^[0-9][0-9][0-9]*\s*//g' | sed 's/^[a-z0-9][a-z0-9]*\s*//g' | cut -d ' ' -f 1)
NUM=$(echo $FORM | cut -d ' ' -f 1)
printf "Dimensions are: $DIM\n"
youtube-dl -f $NUM "$1"
printf "$FORM" &> /tmp/log
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment