Skip to content

Instantly share code, notes, and snippets.

@wyanez
Created July 8, 2011 15:42
Show Gist options
  • Save wyanez/1072116 to your computer and use it in GitHub Desktop.
Save wyanez/1072116 to your computer and use it in GitHub Desktop.
YouTube Downloader
#!/bin/bash
## Two arguments
# $1 Youtube URL
# $2 You name for the video
wget -c --no-check-certificate --user-agent="" $1 -qO- | sed "s/\\u0026/\&/g" | \
awk '/fmt_url_map/{gsub(/[\|\"]/,"\n");print}' | \
sed -n "/^fmt_url_map/,/videoplayback/p" | sed -e :a -e '$q;N;2,$D;ba' | tr -d "\n" | sed -e "s/\(.*\),\(.\)\{1,3\}/\1/;s/\\\//g" | \
wget -c --no-check-certificate --user-agent="" -i - -O $2.flv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment