Linux Son

Live Like A Geek!

  • Archives

  • Hits

    • 2,733 Freinds Looked it up!
  • Meta

  • Advertisements

Download Youtube videos using “Wget”

Posted by hisitech on December 7, 2007

Here there is an easy way to download Youtube videos using wget.  of  course you can do it by some handy Firefox extensions but as i said before do NOT forget command prompt power:

First thing we need is the video ID which we are going to get using also wget together with grep.

First locate the page of the video you want to download, I will use for this example one showing compizfusion in action.

wget -O /tmp/page.tmp http://www.youtube.com/watch?v=UHvAXLBMWGI

Then using cat and grep we will get the video ID

cat /tmp/page.tmp | grep video_id=

This will be the output

var fullscreenUrl = '/watch_fullscreen?video_id=UHvAXLBMWGI&l=51&t=OEgsToPDskKBFLkte03dOnia39Rzd63j&sk=7Ayx8rGROMLJrkh6LkXj7AC&fs=1&title=CompizFusion';
var relatedVideoGridUrl = '/related_ajax?video_id=UHvAXLBMWGI&view_type=G&watch3=1&search=compiz%20linux%20ubuntu';
var relatedVideoListUrl = '/related_ajax?video_id=UHvAXLBMWGI&view_type=L&watch3=1&search=compiz%20linux%20ubuntu';

Check that you have more than one Video_id, but only the first one is the one we want, check that the others says “relatedVideo”, we do not want those ones.

Now download the video.

wget -O /tmp/video.flv ‘http://www.youtube.com/get_video?video_id=UHvAXLBMWGI&l=51&t=OEgsToPDskKBFLkte03dOnia39Rzd63j&sk=7Ayx8rGROMLJrkh6LkXj7AC&fs=1&title=CompizFusion’

check out that I am sending the output to /tmp/video.flv you of course can use any other file and directory you may want, after this you can play the video with any player you usually use.

Advertisements

2 Responses to “Download Youtube videos using “Wget””

  1. M.S.M said

    very interesting..
    dear hisitech!
    you are a good teacher..(did u know?!)
    good luck

  2. CharlesSB said

    I’m gonna try this one for sure.
    Till now I was using http://www.tubeleecher.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: