Well, there are many instances of how to download video’s via youtube. I have tried most of it, some worked well while some did not. Most of the scripts that are written use the old 1.0 version of youtube API which does not seem to work. There is some `t` factor added in the 2.0 version which makes it somewhat difficult to download (at least for me). I went through the API and was able to figure that out.
But, at last I was able to locate a cool script by the name youtube-dl from one bitbucket.org. youtube-dl is a small command-line program to download videos from youtube. It requires the Python interpreter, version 2.x (x being at least 4), and is not platform specific. This works in Linux, Windows or in Mac OS X also. The latest version is 2010.01.19. It is freely available and one can go an modify it also.
You can download it from here.