Use Case: I want to download all the videos I get when I search some keyword in YouTube, and they all have to be at least 4K. I used to have to go get all the urls of the videos I wanted and then use a downloader, but there is a more automated way.
The first thing you need is youtube-dl.
It’s open source software and it’s easy to install.
On Windows go straight to the Downloads page and download the .exe.
You can see right next to that link, another link to something called a Microsoft Visual C++ 2010 Redistributable Package (x86)
All that is, is some support libraries because this app needs because it was written in C++, and it’s a free thing that comes directly from Microsoft. If you’re uncomfortable using their link, you could download it from the Microsoft Website if you wanted.
Download that redistributable and run the installer. Should be fast.
Then download the youtube-dl.exe from the link labelled “Windows exe”.
You can actually run that .exe straight from the Downloads page if you wanted. I don’t even bother completely installing it. I just go and download it again whenever I need it. This also ensures I always have the lastest version.
This might be handy because YouTube could change their site at any time, rendering the old versions of youtube-dl useless anyway.
To open the Windows command line just hold down the Windows key and type “cmd”
Select “Command Prompt” to open the Windows command prompt.
Now you’re going to go into the folder that has your youtube-dl.exe in it
The easiest simplest youtube-dl command goes like this:
That’s it, just pass it the URL of the YouTube video you want.
This won’t guarantee anything about the size that you want though. This also only downloads that 1 single video, it doesn’t let you just enter a search term and download all the videos found.
Do this instead:
youtube-dl.exe "ytsearch1000:my search terms" --ignore-errors -f "bestvideo[width>=3500]+bestaudio/best[width>=3500]"
This will keep searching until it finds 1000 videos from the search terms you entered.
Change 1000 to whatever number you desire.
Change “my search terms” to whatever it is you want the videos to contain eg. cats, beauty, music videos, etc.
— ignore-errors is VERY IMPORTANT, it can throw an error in many different situations, so make sure you include this flag so it will just keep moving onto the next video.
And that’s it!