Download Videos with CLI

We can use a small command-line program called youtube-dl for this purpose. The program is able to download videos (individual and whole playlists) from YouTube and many other websites.

But first of all, why would you actually need this? Here’s couple (probably not all) of reasons:

Install youtube-dl with:

$ yaourt youtube-dl

See available options:

$ youtube-dl -h

Download a video:

youtube-dl -f [FORMAT] http://VIDEO_URL
# Example
$ youtube-dl -f 44 http://www.youtube.com/watch?v=swSn7d_kHQA

To see the available formats:

youtube-dl -F http://VIDEO_URL
# Example
$ youtube-ld -F http://www.youtube.com/watch?v=swSn7d_kHQA

This is archived version of blog, preventing broken links. This version will stay online indefinitely.