[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

youtube download script



YouTube Wget

It accepts all 3 of the following formats for the video id:
http://www.youtube.com/watch?v=PsFd7xFzSbw
http://www.youtube.com/v/PsFd7xFzSbw
PsFd7xFzSbw

The resulting file would be named PsFd7xFzSbw.flv which is a Flash Video
format and is playable by anything using a recent version of ffmpeg. Or
you can convert it to another format.
-- 
Jon
Democracy is a sheep and two wolves deciding on what to have for lunch.
Freedom is a well armed sheep contesting the results of the decision.
#!/bin/sh

CODE=`echo $1 | sed -e 's/^.*v[=/]\([0-9A-Za-z_-]*\).*$/\1/g'`

wget -qO - http://www.youtube.com/watch?v=$CODE | sed -e '/player2.swf?video_id=/!d' -e 's/^.*player2\.swf?\(video_id=.*\)\&l=.*\&\(t=.*\)\&nc=.*$/http:\/\/www.youtube.com\/get_video?\1\&\2/g' | wget -c -i - -O $CODE.flv

Attachment: signature.asc
Description: Digital signature