A Windows batch script that uses yt-dlp to download videos from an M3U playlist or directly from a website link.
Before using this script, you need to have the following installed:
- yt-dlp: Download from https://github.com/yt-dlp/yt-dlp
- ffmpeg: Download from https://ffmpeg.org/download.html
- Extract ffmpeg to
C:\ffmpegso binaries are inC:\ffmpeg\bin
- Extract ffmpeg to
The following folder structure is recommended:
- Edit the
downloader.batfile and update the following paths to match your system:
set "ytDlp=C:\Users\username\Videos\yt-dlp-master" :: Path where yt-dlp.exe is located
set "cookies=C:\Users\username\Videos\yt-dlp-master" :: Path where chrome cookie file is located
set "saveLocation=C:\Users\username\Videos" :: Path where videos will be saved
set "ffmpeg=C:\ffmpeg" :: Path where ffmpeg is installed (binaries in bin subfolder)- (Optional) If you want to use browser cookies for authentication:
- Place your Chrome cookies file in the cookies directory
- The script expects a file named
chromein the cookies path
- Double-click
downloader.batto run the script - When prompted, enter:
- Video URL (required): The URL of the video you want to download
- File name (optional): Custom name for the output file. Press Enter to use the video's original title
- Referer URL (optional): Only needed for some sites that require a referer header. Press Enter to skip
================================
YouTube Downloader Script
================================
Enter video URL: https://www.youtube.com/watch?v=example
Enter file name (optional, press Enter to use video title): my_video
Enter Referer URL (optional, press Enter to skip):
- Downloads best quality video and audio, then merges them
- Downloads all available subtitles
- Remuxes video to MP4 format
- Supports multiple audio streams
- Uses Chrome cookies for authenticated downloads
- Allows custom output filenames
- Supports sites requiring Referer headers
- Continuous mode: Can download multiple videos without restarting the script
- Verify the
ytDlppath in the script points to the correct location ofyt-dlp.exe
- Ensure ffmpeg is installed at
C:\ffmpegwith binaries inC:\ffmpeg\bin - Or update the
ffmpegpath in the script to your installation location
- Make sure the
chromecookie file exists in the cookies directory - Try extracting fresh cookies from your browser
This project is provided as-is for personal use.



