I really enjoy using youtube-dl. I use it on both Windows and on Linux-based systems. It is very convenient. However, sometimes use of the command line gets to be a little tedious, especially when you are essentially reusing the same command with the same parameters. This is why when using Windows I created some batch files to help me.
Preparation: directory environment
In order for this to work, I had created a directory for which both youtube-dl.exe and ffmpeg related files should both reside. If you want the file conversion/audio extraction functionality, you MUST download ffmpeg and extract the ffmpeg files into the same directory as youtube-dl.


As you can observe, I have four different scripts. The simplest one is update.bat. You can create all these files by using notepad and then saving the file as <some text>.bat.
@echo off
youtube-dl -U
pause
All this does is check for updates for YouTube-dl, then downloads them if they exist.
For “[AUDIO]download_youtube_audio.bat”, which downloads a given video and automatically converts it to mp3, you can use the following code:
@echo off
echo Input the youtube video to be downloaded
set /p video=:
youtube-dl -x --audio-format mp3 %video%
pause
I have another batch script that just downloads whatever video and makes sure that it is an mp4.
@echo off
echo Input link representing video to be downloaded
set /p video=:
youtube-dl -f mp4 %video%
pause
Finally, there’s also download.bat which may actually be the most complicated option:
@echo off
:start
echo Input link representing video to be downloaded
set /p video=:
echo.
echo 1. convert to flac
echo 2. convert to vorbis
echo 3. convert to mp3
echo 4. just download the video
echo Conversion option:
set /p option=Type 1, 2, 3 or 4 and then press ENTER:
echo.
if %option%=="1" GOTO dl_flac
if %option%=="2" GOTO dl_vorbis
if %option%=="3" GOTO dl_mp3
if %option%=="4" GOTO dl
:dl_flac
youtube-dl -x --audio-format flac %video%
GOTO EOF
:dl_vorbis
youtube-dl -x --audio-format vorbis %video%
GOTO EOF
:dl_mp3
youtube-dl -x -F mp3 --audio-format mp3 %video%
GOTO EOF
:dl
youtube-dl -k %video%
:EOF
echo.
echo.
echo Done!
exit
This particular batch script gives you a menu before attempting to download and asks you if you’d like to download and convert to flac, Ogg Vorbis, mp3, or to just download the video.
Important: in order for these batch scripts to work, they must have the correct file type. Also note that batch scripts DO NOT WORK on macOS or on Linux-based systems. Similarly named bash scripts will have to be used on those systems, but this guide does not cover bash.
Lastly, you can access my code repository on Github where I have put these scripts.