This batch script allows you to download videos, audios, or music from YouTube using yt-dlp (an improved version of youtube-dl). It provides a simple command-line interface to choose the type of content you want to download and automatically handles invalid selections by defaulting to Option 1 (Video).
- Windows operating system (tested on Windows 10)
- yt-dlp - YouTube video downloader (a more feature-rich alternative to youtube-dl)
-
Make sure you have yt-dlp installed on your system.
-
Clone or download this repository.
-
Open a Command Prompt or PowerShell window in the directory where the batch script is located.
-
To run the script, use the following command:
yt.bat [YouTube-URL]
Replace [YouTube-URL]
with the URL of the video or audio you want to download.
- The script will prompt you to choose an option:
- Enter
1
for Video - Enter
2
for Audio - Enter
3
for Music (with square thumbnail)
-
If you don't enter any option or provide an invalid option, the script will automatically default to downloading the video (Option 1).
-
The downloaded files will be saved in the same directory as the batch script.
The batch script uses yt-dlp to download content from YouTube. The script includes various options to enhance the downloaded files:
- Metadata Parsing: Extracts video metadata such as comments, year, and date.
- Thumbnail Embedding: Embeds the video thumbnail as the cover art in audio files.
- Subtitle Embedding: Embeds subtitles into video or audio files (English only).
- Square Thumbnail for Music: Generates a square thumbnail for music downloads.
- Other Options: Ignores errors and bypasses SSL certificate verification.
- Make sure to comply with YouTube's terms of service when using this script.
- Use this script responsibly and respect copyright laws.
- The script is intended for personal and educational purposes only.
- This batch script is based on the yt-dlp project, which provides an excellent tool for downloading YouTube videos and audio.
Feel free to contribute, report issues, or suggest improvements!
Youtube-dl is a famous program used for downloading videos from YouTube and many other sites. Though alone it handles most cases but for videos of higher quality where audio is present separately we also need FFmpeg to merge video and audio in single file (.mp4, .mkv, etc.) in addition to this we also need Atomic Parsley which is used for adding metadata (Thumbnail, etc.) to downloaded video.
Since all this are command line programs which can be cumbersome to write each time, So I have written scripts files useful for most general cases -
- Highest Quality Audio and Video download
- English Subtitle Addition
- Thumbnail, Metadata and xattrs embedding
- Adding numbering to playlist videos
- Download the whole repository.
- Download Youtube-dl, FFmpeg and Atomic Parsley.
- Put downloaded
.exe
file of youtube-dl,ffmpeg.exe
file from FFmpeg zip extract andAtomicParsley.exe
file from Atomic Parsley zip extract in./bin
. - Add PATH of both folders (
/bin
and/scripts
) to Environment Variables in windows OS. ( see How to add to path)
In cmd/Powershell type
-
yt <video link>
// for single video download -
yt-pl <Playlist link>
// for Playlist download -
yt-m <video link>
// for audio (m4a) file download of single video -
yt-ml <Playlist link>
// for audio (m4a) files download of Playlist -
yt-sc <SoundCLoud link>
// for SoundCloud (m4a) file download -
yt-m-sqthumb <SOundCLoud link>
// for youtube audio (m4a) file download of single video with square thumbnail