youtube-dl is a small command-line program to download videos from YouTube.com. It requires the Python interpreter, version 2.x (x being at least 4), and it’s not platform specific. It should work in your Unix box, in Windows or in Mac OS X. The latest version is 2009.09.13. It’s released to the public domain, which means you can modify it, redistribute it or use it however you like.

Using this command in terminal(Applications/Accessories/Terminal) to install youtube-dl in ubuntu:

sudo aptitude install youtube-dl

Or you can download and get more information from this page.
Now,use this command to learn about youtube-dl’s usage:

man youtube-dl

For example,we want to download video from this URL:http://www.youtube.com/watch?v,and name this video foobar.flv.We use:

youtube-dl -o foobar.flv http://www.youtube.com/watch?v

As YouTube.com videos are in Flash Video format, their extension should be flv. In Linux and other unices, video players using a recent version of ffmpeg can play them.