Wednesday, October 07, 2009

YouTube download - the Open Source and Linux way

Many a times we come across excellent YouTube videos that we would like to save for offline viewing or sharing with friends. There have been many YouTube downloader software that comes standalone or as add-on to the browsers. But somehow I was not much satisfied with whatever downloaders I used - either they took long time to open, or had horrendous GUIs. Most importantly, they were not Open Source. Being a staunch Linux and Open Source user, I knew there would definitely be a better way to do it in the Open Source and Linux world.

Finally I have found the perfect utility for the job called youtube-dl. And fortunately, this can be used in both Linux and Windows (have not tested it here!!) You can download it from here. From the web-site:
"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."
The youtube-dl is actually a Python (a programming language) script, and the authors of the 'youtube-dl' program have released it as Open Source. You can check out the code using any standard editor like 'emacs', 'vim', 'gedit' etc.

In Linux.
To use the 'youtube-dl' program in Linux is pretty easy from the command line. Just download it to any directory, make it executable using the command  chmod +x youtube-dl  and just run ./youtube-dl

For example, I executed the program as follows (a nice Tech Geek Video):
./youtube-dl  http://www.youtube.com/watch?v=m8GDzKQ6oY4
Output of the command:
[youtube] Setting language
[youtube] m8GDzKQ6oY4: Downloading video info webpage
[youtube] m8GDzKQ6oY4: Extracting video information
[download] Destination: m8GDzKQ6oY4.flv
[download] 100.0% of 6.34M at   61.65k/s ETA 00:00 
Use your Movie Players to play the .flv file thereafter!!!

No comments:

Post a Comment