youtube-dl is a small command-line program to download videos from YouTube.com and a few more sites.

Installing youtube-dl is as easy as brew install youtube-dl on OS X.

youtube-dl allows you to download from many online audio/video sharing websites, not just Youtube.

You can use it to download all videos from a playlist, from a channel or simply extracting the audio from a Youtube link.

From a channel:

youtube-dl -citw ytuser:channel_name

From a link/playlist

youtube-dl youtube_link

Listing all available formats:

youtube-dl -F OKbtC223e30

Download a Youtube video as audio

youtube-dl -f bestaudio OKbtC223e30

youtube-dl is included in many distro’s repo but I recommend you to install from the main website for quicker update. The version in the repo is usually very outdated.