You're viewing a comment by xor and its responses.

January 01, 2008, 02:57

Suppose you want to download the top 5 most watched videos with title containing "FOOBAR" in category Music. Using the youtube feeds protocol you can do something like this:

GET "http://gdata.youtube.com/feeds/api/videos/-/Music/?vq=FOOBAR&orderby=viewCount&max-results=5" 
| xmllint --format -|grep "media:player"|cut -d\" -f2 |clive -y -s

xmllint --format will obviously format the downloaded XML file so we can easily extract the needed URL of the video located under the "media:player" tag.
Next we pipe the output the clive which will know how to handle the url and retrieve the flv file. Optionally you can pipe it to get_youtube_vids.awk if it accepts downloading multiple files, however clive has more options and can even encode the vids after download :)

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "floppy_12": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.