windows batch script youtube mp3 downloader with yt-dlp

useful windows batch script to download youtube mp3 with yt-dlp NOTE: before using this script, you need to download yt-dlp first! ===================================================== @echo off setlocal EnableDelayedExpansion if exist "%~dp0yt-dlp.exe" ( set "YTDLP=%~dp0yt-dlp.exe" ) else ( where yt-dlp >nul 2>&1 if errorlevel 1 ( echo. echo Error: yt-dlp not found! echo Make sure yt-dlp.exe is in the same folder as this script OR added to the windows environment PATH variable pause exit /b ) else ( set "YTDLP=yt-dlp" ) ) echo =============================== echo YT-DLP YouTube to MP3 Downloader echo =============================== echo. set /p url=Enter YouTube URL: echo. echo === Available m4a (MP4) audio formats === %YTDLP% -F %url% | findstr /C:"audio only" echo =============================== echo. set /p format=Enter the audio format code you want to download: echo. echo Downloading format %format% as MP3... %YTDLP% -f %format% --extract-audio --audio-format mp3 --no-write-thumbnail --no-playlist "%url%" echo. echo Done! pause

Public Last updated: 2025-07-25 07:34:48 AM