Skip to content

Instantly share code, notes, and snippets.

@nonchip
Last active August 29, 2015 13:55
Show Gist options
  • Save nonchip/8741097 to your computer and use it in GitHub Desktop.
Save nonchip/8741097 to your computer and use it in GitHub Desktop.
host="my_password@mpd_host"
page_url="$1"
echo "Page url: $page_url"
flv_format="$(youtube-dl -F "$page_url" | grep 'flv' | head -n 1 | cut -f 1)" || exit 1
echo "FLV format: $flv_format"
video_url="$(youtube-dl -g -f $flv_format "$page_url")" || exit 1
echo "Video url: $video_url"
mpc -h $host add "$video_url"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment