Friday, November 28, 2008

Rip Youtube the CLI way

There are many applications for extracting and downloading videos from youtube and other video hosts like web-based KeepVid or addons like VideoDownloader, and many others. There's also a very good technique of saving any streaming video by buffering it till 100%, navigate to the Cache folder and simply copy the video file (which is /tmp in case of linux).

But recently I got a python based CLI tool youtube-dl, which is a nifty yet a powerful must have tool. You can get it from your default repositories or for youtube-dl under Windows XP. Get it :

$ sudo yum install youtube-dl

  • Simply download :
    $ youtube-dl

  • Specify filename

    Manually specify :
    $ youtube-dl -o output.flv
    Use the original video title :
    $ youtube-dl -t
    Have a literal title :
    $ youtube-dl -l

  • Download videos which requires your youtube account privileges and confirmation :
    $ youtube-dl -u username -p password

    Or read account details from .netrc file :
    $ youtube-dl -n
    Append this line to ~/.netrc file :
    machine youtube login username password password

  • Simply print video URL instead of downloading :
    $ youtube-dl -g
    Or grab the Title :
    $ youtube-dl -2

  • Download in silent mode (like wget) :
    $ youtube-dl -q &

  • Get Help :
    $ youtube-dl -h

Know more at the Official Page.