YT-DLP is a command-line program that allows you to download videos from various websites, such as YouTube, Vimeo, Dailymotion, and more. It is a fork of the popular youtube-dl program, which is discontinued.

Previously, I have shared how to use yt-dlp on Windows. Here, I will show you how to install and use yt-dlp on a Mac computer.

Install yt-dlp on Mac

The easiest way to install yt-dlp on Mac is through Homebrew, a package manager for Mac that lets you install various software easily. You can follow the steps below to install yt-dlp on your Mac. 

Step 1. Open the Terminal app and paste the following command. 

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 2. Press Enter and follow the instructions on the screen. You may need to enter your password and confirm some prompts.

Step 3. Once Homebrew is installed, you can use it to install yt-dlp. In the same Terminal window, type the following command and press Enter. 

brew install yt-dlp

Now, you have yt-dlp installed. Alternatively, you can also install yt-dlp using the command below if you have Pip installed : 

pip3 install --upgrade yt-dlp

Basic Usage of yt-dlp Commands

Now you are ready to use yt-dlp. To download a video, you need to provide its URL as an argument to the yt-dlp command. For example, you can use the following command to download a YouTube video. 

yt-dlp https://youtu.be/Jbqzoh6noic

Yt-dlp will start downloading the video to your current directory. You can see the progress and speed of the download on the Terminal output.

You can also specify various options and flags to customize your download. For example, you can choose the format, quality, filename, subtitles, and more. To see all the available options, type:

yt-dlp --help

You can also check out the official documentation at https://github.com/yt-dlp/yt-dlp for more details. Here are a few examples of using yt-dlp commands:

– To download multiple videos, you can specify multiple URLs separated by spaces, or use a batch file with one URL per line, and run.

yt-dlp -a batch-file.txt

– To download the video in the best quality and save in MP4. This requires FFmpeg to be installed.

yt-dlp -f 'bestvideo+bestaudio/best' --merge-output-format mp4 https://youtu.be/9cMZLEkYcGY

– To download only the audio and convert it to mp3 format.

yt-dlp -x --audio-format mp3 https://youtu.be/9cMZLEkYcGY

– To download videos with embedded subtitles.

yt-dlp --write-subs --embed-subs --format mp4 <video_url>
yt-dlp On Mac Download Subtitles

By default, yt-dlp will save the downloaded files to your user folder. You can also use this command to download videos to your Downloaders folder.

yt-dlp -o '~/Downloads/%(title)s.%(ext)s' <video_url>

Use yt-dlp to Download Private Videos

Yt-dlp can also use cookies from your web browser to access videos that require authentication or are region-locked. In this blog post, I will show you how to use yt-dlp to download private videos on YouTube and other websites. 

Here are some examples of using yt-dlp authentication options to download private videos:

– To download a video from a website that requires a username and password, you can use the -u and -p options, followed by your credentials. For example:

yt-dlp -u myusername -p mypassword https://example.com/video

– To download a video from a website that requires an API key, you can use the –add-header option, followed by the header name and value. For example:

yt-dlp --add-header "X-API-Key: myapikey" https://example.com/video

If you have enabled two factor authentication, it is recommended to use cookies file. Depending on the browser you use, use a extension to export cookies.txt file. You need to visit the website that has the video you want to download and click on the extension icon. It will generate a file called cookies.txt that contains the cookies for that website. Save this file to a convenient location.

Once you have the cookies file, specify the path to the cookies file using the –cookies option. For example:

yt-dlp --cookies ~\Downloads\cookies.txt https://youtu.be/_gPPD5lPB4M

One of the improvements of yt-dlp over youtube-dl is that it can access cookies from your specified browser. So if the cookies files you get from Chrome, you can simply run the command below without downloading the cookies.

yt-dlp --cookies-from-browser chrome https://www.youtube.com/watch?v=_gPPD5lPB4M
yt-dlp Mac Download Private Videos

Use yt-dlp with Shortcuts for Mac

Shortcuts is a powerful app that lets you automate tasks on your Mac. If you don’t want to always type the command, you can use Shortcuts to run shell commands. I have made one shortcut to run the yt-dlp command to download videos. 

yt-dlp For Mac Shortcut

You can have my shortcut and modify it in your way. For quick access, you can also add it to dock or menu bar. Whenever you want to downlaod a video, simply copy the URL and click to run this shortcut. 

This yt-dlp shortcut offers 4 options: Normal Download, Download Audio Only, Download Video Best Quality, and Download Private Video. Except for Normal Download, the other three options require FFmpeg to be installed. 

The Download Private Video option will get cookies from your Chrome browser. If you use a different browser, change the command accordingly. To download a private video, it is recommended to use Chrome to play the video first. 

Conclusion

Yt-dlp supports more than 1000 websites, including popular platforms like YouTube, Vimeo, TikTok, etc. In addition, yt-dlp allows you to customize your downloads according to your preferences. 

However, you need to remember the parameters to choose the format, quality, speed, subtitles, metadata, and more. Hopefully, my shortcut will help you use yt-dlp on Mac. If you still prefer a GUI downloader app for Mac, I would recommend 4K Video Downloader

3 thoughts on “How to Use yt-dlp on Mac from Terminal or Shortcuts”

Leave a Reply

Your email address will not be published. Required fields are marked *

You cannot copy content of this page