Bulk /(YouTube|Video)/ Downloader
Download multiple videos at once with one simple script.
Works with Youtube and all other sites supported by yt-dlp.
Prerequisites
- Download
yt-dlp- For Linux-based systems, this is probably the easiest way
- For Windows, winget might be the easiest, although if you don’t have winget, just download the
.exeand put it somewhere in your PATH (if you don’t know what that is, create a folder calledyt-dlpinC:\Program Files, put the exe there, do Win + R,systempropertiesadvanced, Environment Variables, in System variables double click onPath, new,C:\Program Files\yt-dlpand OK all the way out), in that case useyt-dlp -Uto update it later - If you have it installed with
pip, make sure to update it to the latest version that hasejssupport by runningpip install -U yt-dlp[default]
- Download
FFmpeg - Download
Deno(required to support YouTube download with the latestyt-dlpversions)- For Linux-based systems, run
curl -fsSL https://deno.land/install.sh | sh - For Windows, either run
winget install DenoLand.Denoorirm https://deno.land/install.ps1 | iexin Powershell
- For Linux-based systems, run
Usage
- Download the script file
bulk-youtube-download.bat(orbulk-youtube-download.shfor Linux/Mac) and put it somewhere you want - Create a text file called
links.txtin the same folder as the script - Put your links in the
links.txtfile as a JSON array, for example :json[ "https://youtu.be/7ssVNgOK_MM", "https://youtu.be/xyLWY2wXbho", "https://youtu.be/p0dw-276t7w", "https://www.youtube.com/watch?v=dYVoZJXuhxk", "https://www.youtube.com/watch?v=1TwBc7B46X0", "https://www.youtube.com/watch?v=h2csePLbahQ", "https://www.youtube.com/watch?v=-m1EzV-i3WI", "https://www.youtube.com/watch?v=-JdZsKzYWhI" ] - Open a terminal/command prompt in the folder where you put the script and the
links.txtfile - Run the script :
- On Windows :
.\bulk-youtube-download.bat - On Linux/Mac :
./bulk-youtube-download.sh
- On Windows :
- Congrats, the videos are now in the
downloadsfolder !
Default download options and how to change them
By default, the script uses the following options :
- Format : best video + best audio, fallback to best if not available
- Embed subtitles (if available)
- Embed thumbnail
- Embed metadata
- Embed chapters (if available)
- No playlist (only download the video if a playlist link is given)
- Display progress bar
- Output folder :
downloads(created if it doesn’t exist), filename format :Video Title [Video ID].ext
To change these options, just pass what you want after the script name, for example .\bulk-youtube-download.bat -f "bestvideo[height<=720]+bestaudio/best" --no-embed-subs -o "downloads/%%(title)s.%%(ext)s".
A list of options can be found here.
Here are some options that might be worth using :
--yes-playlistif you want to download full playlists when a playlist link is given-s -Fto see the available formats for each video without downloading-f "format"to specify the format to download, see this-o "downloads/output_template: change the output folder and/or filename format, see this
⚠️ WARNING : on Windows, make sure to double the%signs in the output template (example : use%%(title)sinstead of%(title)s). Also it’s best to keep thedownloads/part to avoid cluttering the script folder with all the downloaded videos--sub-langsto specify which subtitles to download, use--list-subsbefore to see available languages-xto extract audio only for videos that don’t provide separate audio and video streams--force-keyframes-at-cuts --sponsorblock-remove sponsor,selfpromoto remove segments of the video, see this for available categories. The--force-keyframes-at-cutsoption is recommended to have better results when cutting the video, although it takes longer to process
How to download all videos from a channel ?
- Go on the Youtube channel, go on the Videos tab, reload the page and scroll down until no new video pops out (yes it can take some time)
- Open the console (F12 -> Console) paste the following line and hit enter :
js
copy(Array.from(new Set(Array.from(document.links).filter((l) => l.href?.includes("watch?v=")).map((x) => x.href.split("&")[0])))) - Open the
links.txtfile, delete everything, paste (Ctrl + V) and save the file
Tip
if you see no link, run the following command instead :
js
copy(Array.from(new Set(Array.from(document.links).filter((l) => l.href?.includes(".be/")).map((x) => x.href.split("&")[0]))))
Demo
You have an error ?
- The video may be geo-restricted
- If you have any special error message, open an issue here first to not bloat yt-dlp’s repo