How to Use YT-DLP

Originally Posted 7/14/23; Updated 10/15/23

a screenshot of the download page for YT-dlp

Background

YT-DLP is a piece of software that will download YouTube Videos in a variety of formats including MP3s (audio files) and MP4s (Video Files). It works on Windows, and I have not tested it on other operating systems. It can be pretty... confusing on how to use/ how to setup. At least for me, I often forget which commands to use, or where exactly I saved the files to.

In this article, I'll be going over how to download and setup YT-DLP the long way, and a simpler way I've figured out. I'll start with the long way so you can see the background steps, and then explain the easy way. If you want though, feel free to just skip down to the easy way.

One note: This is one of the more complicated things I've explained. I originally typed this all out in a CoHost post , and then had my Girlfriend who's not very tech literate try it, and it worked. So I think if she can follow it, the instructions should be pretty follow-able.

The Long Way

  1. Create a Folder on your computer for YT-DLP. This isn't necessary, but I find it makes things easier.
  2. Download YT-DLP.
  3. Download FFmpeg. Make sure to put ffmpeg in the same folder as where you save YT-DLP. You might have to run FFmpeg once it's downloaded for it to set up correctly? It's been a while since I've done the setup process
    • Click the link, click "download". On the left hand side, you'll see "Get packages & Executable files". Click the windows logo. Click "windows builds by BtbN. Click here for a screenshot. Find where it says "ffmpeg-master-latest-win64-gpl.zip". Click here for a screenshot Clicking the link in the screenshot should download it. Find the zip file you downloaded (typically in the downloads folder), and move it to the folder where yt-dlp.exe is. Extract or open the zip file (depending on your version of windows, the process of this might be a bit different). Inside the zip file, double click ffmpeg-master-latest-win64-gpl, then double click bin. You should see 3 files in there (ffmpeg, ffplay, ffprobe). Copy and paste those into the folder yt-dlp.exe is in. When I say I'm not sure if you need to run ffmpeg to get it setup, that would just be double clicking that file once you move it to where yt-dlp.exe is. It will only show up on the screen for a split second (or sometimes not even that long), so if you click it and it seems like it's not doing anything, just move along.

From here, things become less intuitive. There's a whole list of commands here for things with YT-DLP. However, in general, the command to use is "yt-dlp -x --audio-format mp3 youtube link" (without the ""; and this is for MP3s) . To enter that command, you need to use your command prompt. If you're unfamiliar:

  1. Open "Command Prompt" on your (Windows) Computer
    • The easiest way to do this would be to go to windows search bar, and search for "Command Prompt"
  2. Get the address of where your YT-dlp is saved. For example, if you saved it in its own folder on the desktop, the standard location would be C:\Users\Username\Desktop\Whatever you named the YT DLP folder .
    • To figure out where you saved something (in general), open the location in file explorer, and click the like, "address bar" at the top. Make sure to click on an empty space in the address bar to see the full location. It should look like this if done correctly. You can then just press "Ctrl" and "C" at the same time to copy the address (right clicking and pressing "copy" should also work) . For default folders like Desktop, Downloads, Pictures, Videos, it might not give the full location. So start by going to "This PC" -> C drive -> Users -> Your Username -> And then find whatever directory you want
  3. In Command Prompt, type "cd file path" (don't include the quotes. Just using them to show what to type). Replace file path with whatever the location of the yt-dlp.exe file that you downloaded is (from the example above, it would be C:\Users\Username\Desktop\Whatever you named the YT DLP folder)
    • To paste into command prompt, either just right click or press the keyboard shortcut "Ctrl" and "V". Also, make sure to put a space between "cd" and the file path. Also, after you type a command in Command Prompt, press "enter" for it to run
  4. Type "yt-dlp -x --audio-format mp3 youtube link" now that Command Prompt is in the right location, press enter, and it should download whatever YouTube video you want as an mp3 and save it in the folder that yt-dlp.exe file is in.
    • Note: For video (mp4), the command that I use would be yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best youtube link"
      • Note here: the " before bestvideo and " at the end are necessary

An Easier Way

So, because this is something I use infrequently, I often forget the correct terminology for the commands, and also lose track of the folder. So, instead, I made a .bat file that runs the commands for me. A .bat file will run Command Prompt for you.

  1. Download YT-dlp and FFmpeg as described above (Steps 1-3 in the first section). Create a folder (if you'd like), put them in there.
  2. Open "Notepad"
    • The easiest way is to go to the search bar in Windows and search for "notepad"
  3. Copy and Paste the following code:
  4. In the second line, replace \Users\User\Documents\YT DL stuff with the location of where your YT-dlp.exe lives. Do the same thing in the second to last line. (Note: in the second line, you don't need the C:)
    • Make sure to only replace what's between the "" with the new file location in that second to last line. My girlfriend wanted to replace everything after the ( which is wrong.
  5. In the "Notepad" program, click "file", "save as", and choose a location of where to save the file (I typically do my desktop). Change the file type to "all files", and when you name the file, put ".bat" at the end. So, for example "Youtube Downloader.bat". Then press save
  6. When you want to download something from Youtube, just double click the file you created and paste the youtube video link!
    • Then you press "enter" once you paste the link. Once it's done downloading, press Y or N when prompted

Note: The above code downloads a YouTube video as a mp3 file. If you'd like it as a mp4 (video) file, copy and paste this code instead for step 3 above. I personally have one .bat file for video, and another for audio, so they're just ready to go no matter what I need:

Explanation

So, what that code is doing is it'll open Command Prompt, and navigate to the folder where YT-dlp.exe is (step 2 in the code above). Then it will ask you "Input Youtube Link". You'll paste in the youtube video you want and press enter. Then, it runs the command to extract audio (or video) from the link you put in. Once it's done running everything it needs to, if all goes well, it'll ask you if there are any more videos to download. Type "Y" then press enter for Yes, or press "N" and then enter for no. If yes, it'll ask again to input a youtube link. If no, it'll open the file that the video saved to (or, whatever you put in that second to last line of code)I know this seems kind of long and daunting, but once it's setup you can pretty much just double click that file on desktop, paste in the link, and you don't have to think about it again. Also, I'm not super knowledgeable on how YT-DLP works, so someone might have a better way to do it.

Conclusion

Okay and that wraps up this tutorial! If you know a better way to setup YT-DLP, feel free to reach out and let me know! Or, if I didn't explain something well enough, also reach out and let me know and I can try to make it more clear!