2007-03-14

Wanna download a YouTube video?

If you want to download a YouTube video it is really easy with the shell. All you have to do is to pick up the video_id in the URL and feed it to the script. It will then fetch the valid URL to download the flv video.

But that's not why I want to blog about it because there are already scripts to download YouTube videos. The reason I'm blogging is because it is a one-liner.

wget "http://www.youtube.com/get_video?`wget -q -O - "http://youtube.com/watch?v=$1" | egrep -m1 -o 'video_id=[^&]+&l=[0-9]+&t=[^"&]+'`" -O $1.flv

Note: $1 is the video_id parameter sent to the script.

Download the script.

5 comments:

  1. The egrep has evolved since the time of that post :

    egrep -m1 -o 'video_id=[^&]+&l=[0-9]+&sk=[^&]+&fmt_map=[^&]+&t=[^"&]+'

    And a less strict regex would be 'video_id=.*&t=[^"&]+'

    ReplyDelete
  2. Making money on YouTube is possible, but it won't be a quick process. Marketing is everything in the virtual world, so promote as much as you can. Facebook, MySpace, and Twitter are other great ways to generate traffic to your YouTube account or your blog. Insightssuccess.com

    ReplyDelete
  3. Hi, actually love the style of your web site. Would you mind telling me what theme you happen to be utilizing? I’m new to this and I’m hoping to get mine looking anywhere near as cool as yours. Thanks a great deal. https://www.buyyoutubesubscribers.in

    ReplyDelete