Skip to content

Instantly share code, notes, and snippets.

@kevinlipe
Created December 29, 2011 16:04
Show Gist options
  • Save kevinlipe/1534733 to your computer and use it in GitHub Desktop.
Save kevinlipe/1534733 to your computer and use it in GitHub Desktop.
youtube-dl wrapper
#!/bin/sh
# wrapper around youtube-dl, from TJ Luoma (http://luo.ma)
FOUND=no
# these are the mp4 formats that YouTube supports, starting with the highest resolution
for FORMAT in 38 37 22 18 17
do
echo "$NAME: Trying $FORMAT ..."
if [ "$FOUND" = "no" ]
then
youtube-dl -f "$FORMAT" --no-overwrites \
-o "%(stitle)s-%(id)s.%(ext)s" "$@" && FOUND=yes # to use with burninator.scpt, this path has to be hard-coded.
fi
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment