How to download youtube video from Terminal Mac?

First thing you need to do is install the plugin called youtube-dl To install youtube-dl follow the steps below or visit link.

To install it right away for all UNIX users (Linux, OS X, etc.), type:

sudo curl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl

You can use Homebrew if you have it:
brew install youtube-dl

To download video from Terminal Mac

Once, you have that installed, all you need is to hit the command from your terminal as:

Sureshs-MacBook-Pro:~ sureshkumarmukhiya$ youtube-dl

youtube-dl is a feature rich utility, you can also download video in another format. All you need to use is -f option of this utility. Here is what the man page of this utility has to say about -f option :

-f FMT, –format=FMT
Specify the video format (quality) in which to download the video.

For, in particular, the meaning of the format codes is given as:

WebM video at 480p: 43
WebM video at 720p: 45
H264 video in MP4 container at 480p: 18
H264 video in MP4 container at 720p: 22
H264 video in MP4 container at 1080p: 37
H264 video in FLV container at 360p: 34
H264 video in FLV container at 480p: 35
H263 video at 240p: 5
3GP video: 17
For more options, see the man page of youtube-dl.

Download MP3

To download MP3 version of the video, you the command like:

youtube-dl –extract-audio –audio-format mp3 <video URL>


youtube-dl –extract-audio –audio-format mp3

Note this needs, ffmpeg or avconv installed.


Tags :

About the Author


I am backend developer with passion in Web Application development using latest technologies like Laravel, PHP7, React, ECMAScript 6 and WordPress. I prefer spending time analyzing big data with Apache Spark. Apart from that, I do photography.