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,
aptis probably the easiest way - For Windows,
wingetmight 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-dlpin%APPDATA%, put the exe there, do Win + R,systempropertiesadvanced, Environment Variables, in System variables double click onPath, new,%APPDATA%\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]
- For Linux-based systems,
- 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", "https://www.youtube.com/playlist?list=PLliBvQE3gg9doyZ2XgGOFMn4FHzdZquuZ", "https://www.youtube.com/@snaptic.3d/videos", "https://www.youtube.com/@snaptic.3d/shorts" ]
Note
Supported URL types :
- Single videos
- Playlists
- Channel
/videospages - Mixed URLs together
- 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)
- Playlist support in addition to single videos
- Resume interrupted downloads
- Parallel fragment downloading for faster downloads
- Retry failed downloads automatically
- Output folder :
downloads(created if it doesn’t exist), filename format :Video Title [Video ID].ext, in a subfolder named after the playlist if the video is part of a playlist
Downloads are automatically organized like this :textdownloads/ ├── Video title [VideoID].mp4 └── Channel name/ ├── 1 - Video title [VideoID].mp4 └── 2 - Video title [VideoID].mp4 └── Playlist name/ ├── 1 - Video title [VideoID].mp4 └── 2 - Video title [VideoID].mp4
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 :
no-playlistif you want to skip playlist links--cookies-from-browser chromefor private/age restricted videos-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
- The video may be private
- The video may be age-restricted and require cookies
- Youtube is rate limiting you
- Missing cookies (in some cases)
- Outdated
yt-dlp - If you have any special error message, open an issue here first to not bloat yt-dlp’s repo
Credits
- Script created by myself (@EDM115)
- Inspired by a request of Crystal
- With improvements from @Abhijithsp