How to Download YouTube Videos and Playlists with youtube-dl on Windows, Linux, and macOS (Tutorial)

Table of Content

Want to download YouTube videos for offline use or save an entire playlist for a long flight? youtube-dl is your go-to open-source tool for this. It's simple, efficient, and works across multiple platforms.

In this guide, we'll show you how to install youtube-dl on Windows, Linux, and macOS, and demonstrate how you can use it to download both individual videos and entire playlists. Let's dive in!

Advanced Youtube Client for Windows: Download Social Media Videos for Free from YouTube, Facebook, Instagram and More.
AYC is a highly responsive, no nonsense, easy to use, fast video downloader from the text based era. Features * Download from Youtube, Reddit, Twitter, Facebook, Instagram, Twitch, Dailymotion, Vimeo and 100s of other websites that yt-dlp supports. * Automatically saves video chapters, thumbnails and subtitles (User configurable). * Downloads playlists, channels, keyword

What is youtube-dl?

youtube-dl is a powerful, command-line tool for downloading videos from YouTube and other video-sharing sites. It's free, open-source, and supports a wide range of options. You can download specific video formats, extract audio-only versions, and even grab entire playlists.

And don't let the "command-line" part intimidate you! It's simpler than it sounds.

1. Installing youtube-dl

On Windows

  1. Download the executable: Go to the official GitHub page and download the latest version of youtube-dl:
    https://github.com/ytdl-org/youtube-dl/releases
  2. Place it in a convenient location: Move the downloaded youtube-dl.exe file to a folder, e.g., C:\youtube-dl.
  3. Add it to your system PATH:
    • Right-click on Start and go to System > Advanced system settings.
    • Click Environment Variables.
    • In the System Variables section, find Path, click Edit, and add the path to the youtube-dl.exe (e.g., C:\youtube-dl).
  4. Install FFmpeg (optional but recommended): This helps with downloading and converting high-quality formats.

Verify the installation: Open Command Prompt and type:

youtube-dl --version
24 Apps and Scripts to Download YouTube Videos For Free
There are many reasons why someone might want to download YouTube videos. Maybe they want to watch the videos offline, without an internet connection, or maybe they want to save the videos for future reference. Whatever the reason, there are a variety of apps and scripts available to help you

On Linux

Most Linux distributions make it easy to install youtube-dl via the package manager. For example:

Ubuntu/Debian

sudo apt update
sudo apt install youtube-dl

Fedora

sudo dnf install youtube-dl

Arch Linux

sudo pacman -S youtube-dl

Install FFmpeg

To download high-quality videos or audio, install FFmpeg:

sudo apt install ffmpeg   # For Debian/Ubuntu

On macOS

If you use Homebrew, installing youtube-dl is a breeze:

brew install youtube-dl

To install FFmpeg alongside it:

brew install ffmpeg

Verify Installation:

youtube-dl --version

2. Downloading YouTube Videos

Now that you've got youtube-dl installed, let's start downloading videos!

Basic Video Download

To download a single video, use:

youtube-dl <video-URL>

Example:

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

By default, this will download the highest quality available.

Downloading a Specific Format

Want to choose a particular resolution or format? Use the -F option to list available formats:

youtube-dl -F <video-URL>

Example Output:

format code  extension  resolution
249          webm       audio only
250          webm       audio only
140          m4a        audio only
160          mp4        144p
133          mp4        240p
134          mp4        360p
135          mp4        480p

To download a specific format, use:

youtube-dl -f 134 <video-URL>

Extracting Audio Only

Want just the audio from a video? This is useful for podcasts or music tracks:

youtube-dl -x --audio-format mp3 <video-URL>

3. Downloading YouTube Playlists

Yes, youtube-dl can handle entire playlists!

To download a full playlist, simply provide the playlist URL:

youtube-dl <playlist-URL>

Les see by an example:

youtube-dl https://www.youtube.com/playlist?list=PLx0sYbCqOb8TBPRdmBHs5Iftvv9TPboYG

Downloading Only Specific Videos from a Playlist

You can download specific videos by their index. For example, to download only videos 1, 3, and 5 from a playlist:

youtube-dl --playlist-items 1,3,5 <playlist-URL>

4. Advanced Tips

Download Subtitles:

youtube-dl --write-sub --sub-lang en <video-URL>

Set a Custom Download Directory:

youtube-dl -o "~/Downloads/%(title)s.%(ext)s" <video-URL>

Resume Interrupted Downloads:

youtube-dl -c <video-URL>

Wrapping Up

youtube-dl is a versatile tool that makes downloading YouTube videos and playlists a breeze. Whether you're on Windows, Linux, or macOS, you now have a reliable way to save your favorite content for offline viewing.

And remember, always respect copyright laws and YouTube's terms of service!

Happy downloading!

Additional Resources:


28 Free YouTube Clients, Frontends and Video Downloader Programs for Windows, Linux and macOS
In today’s digital age, YouTube has become an indispensable resource for entertainment, education, and information. However, the official YouTube app and website can sometimes be limiting due to ads, lack of certain features, and privacy concerns. This is where alternative YouTube clients, frontends, and video downloader programs come into
16 Free YouTube Music Clients for Linux, Windows, macOS and Android
YouTube Music is a popular streaming service offering access to millions of songs, playlists, and music videos. While it provides a vast library and personalized recommendations, using the default YouTube Music app has some downsides, including intrusive ads, limited offline access, and restricted background playback. Free YouTube Music clients for







Open-source Apps

9,500+

Medical Apps

500+

Lists

450+

Dev. Resources

900+

Read more