How to Use youtube-dl to Download Videos From YouTube on Windows

Download Youtube Videos with youtube-dl

Update: youtube-dl appears to be having technical difficulties recently. In case it isn’t working for you, try yt-dlp instead.

If you want to learn how to use youtube-dl to download videos from YouTube and other video sites onto your PC, here’s a tutorial just for you. This method is for Windows 7 / 8 / 10, although youtube-dl also works on Linux and Mac. To operate youtube-dl, you will make use of the command line (with cmd.exe), but don’t be alarmed. The process is easy and doesn’t require technical knowledge.

Youtube-dl is a free, open-source program which is lightweight (~8 MB) yet very powerful. It lets you download videos in different formats from YouTube, Vimeo, Dailymotion, Facebook, Instagram, Archive.org, BuzzFeed, Cracked, and tons more.

What’s awesome about youtube-dl is that you can choose the quality of your downloads (from low-res to full HD) and you can also resume unfinished downloads at any time.

Is it legal to download from YouTube?

If you’re downloading the latest music hits so you can sell them to your friends, then obviously no, that’s illegal. But there are many cases where downloading YouTube videos is legal – for example, if the original video creator gives you permission to do so.

Not all YouTube videos are uploaded simply to make money; lots of them are intended for educational or humanitarian purposes, and these video creators encourage the downloading and archiving of their content. In particular, videos that fall under a Creative Commons (CC) license are eligible for downloading, though perhaps not for redistribution in all cases.

Installing youtube-dl

Download the latest youtube-dl.exe from the official site. An alternate download page can be found at ytdl-org.github.io.

You will also need the Microsoft Visual C++ 2010 Redistributable Package (x86) from the Microsoft site, if you don’t have it already.

In fact, there’s nothing to install, as the youtube-dl.exe file is ready to use as a command line program. Save youtube-dl.exe to your Windows user directory (e.g. C:\Users\MyUser) to make it easy to access when you open the Windows command line with cmd.exe.

Tip: If you want to use youtube-dl.exe from any directory within the command line, you can add youtube-dl to your Windows PATH environment variable.

To add youtube-dl to PATH for all users, you first have to place youtube-dl.exe in a location that every user can access (e.g. C:/Program Files). Then, open cmd.exe as Administrator and paste the following command:

setx /M path "%PATH%;C:\Program Files"

The setx command sets the new PATH variable permanently, while the /M option makes it apply to the System PATH (for all users). Note that you must only add the folder where youtube-dl.exe is stored, not the actual filename. Close cmd.exe and open it again for the change to take effect.

Downloading videos with youtube-dl

    1. Go to YouTube.com and find the video you want to download. While watching the video, copy the website URL. It will look something like this: https://www.youtube.com/watch?v=gfKy67IqRBY
    2. Click the Start button in Windows and type in “cmd”, then click on cmd.exe.
    3. At the command prompt, type the following to display a list of formats available (-F option):
      youtube-dl.exe -F https://www.youtube.com/watch?v=gfKy67IqRBY

      youtube-dl Formats Available

    4. Now, look at the format numbers on the far left column and choose your desired format with the -f option (lowercase now, not capital -F!).

For example, we’ll use “-f 22” because it’s the highest quality for this video with combined audio and video. If you only want the video, or only the audio, then look at the formats listed and choose the code that corresponds with “audio only” or “video only” in the quality you desire.

youtube-dl.exe -f 22 https://www.youtube.com/watch?v=gfKy67IqRBY

youtube-dl Downloading

And that’s it! The video is now saved to your user folder on your computer.

For more advanced options such as geographic restriction bypassing and extra download settings, see the youtube-dl README at GitHub.

3 thoughts on “How to Use youtube-dl to Download Videos From YouTube on Windows”

    1. You have to make sure that the format does not say: video only or audio only.

      If you want both video and audio, you can run youtube-dl.exe on the YouTube URL without any options. When you run it without options, it should find the combined video + audio file for you (which doesn’t always seem to be the best quality possible, for whatever reason).

Leave a Reply

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