Download YouTube videos from the CLI (OS X)

Sometimes you need to “save” some important content from YouTube, for example, if you need to make an offline presentation or your internet connection is slow maybe it’s a good idea to download the video before the presentation. Good idea, no?

There are some solution to this, but maybe this is the simples one (for me). With YouTube-dl you can download your videos from YouTube straight from your command line like this

youtube-dl ABCDEF_1234

Where ABCDEF_1234 is the “v” param of https://www.youtube.com/watch?v=ABCDEF_1234

(edit) Today this command doesn’t work with this URL https://www.youtube.com/watch?v=-GymG5y0Yt8. You can notice that the param start with a dash symbol (-), so t he program “think” that is a extra flag. To solve this, make sure that you are running the latest version, running:

youTube-dl -U

And then, pass the entire URL

youtube-dl "https://www.youtube.com/watch?v=-GymG5y0Yt8"

That’s all!