Skip to content

Instantly share code, notes, and snippets.

@MShahine
Created August 5, 2020 10:36
Show Gist options
  • Save MShahine/99261bb16f5149545d2a756fe9801b8a to your computer and use it in GitHub Desktop.
Save MShahine/99261bb16f5149545d2a756fe9801b8a 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