Last active
March 14, 2022 03:43
-
-
Save seamonkey420/03bddc91c840d9dcd7c3c160d758fd10 to your computer and use it in GitHub Desktop.
Easy batch file to just download a single youtube video or playlist via YT-DLP. Update variables to where yt-dlp is saved and where you want videos saved to.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: ------------------------------------------------------------- | |
:: Quick way to download youtube vids via yt-dlp | |
:: Set yt-dlpLOC to where yt-dlp.exe resides | |
:: yt-dlp set to embed thumbnails and metadata | |
:: set to force US geolocation and use best quality options | |
:: outputs video files as mp4 | |
:: Opens up folder where videos are saevd to once completed | |
:: Seamonkey420 3/10/2022 | |
:: -------------------------------------------------------------- | |
@echo off | |
::Variables, Update to match your system | |
set yt-dlpLOC=C:\Users\username\Downloads\YT | |
set SaveToLocation=C:\Users\username\Downloads\YT\Downloads | |
:Main | |
set /p url="Paste URL for Youtube Video or Playlist to Download: " | |
"%yt-dlpLOC%\yt-dlp.exe" -f b --geo-bypass-country US --embed-thumbnail --add-metadata --compat-options embed-metadata -P "%SaveToLocation%" "%url%" | |
explorer.exe "%SaveToLocation%" | |
pause |
nevermind, just need to use " " around variable to avoid escapable characters issues, all fixed.
To add to right-click / context window on the desktop, create a cmd of the code and then update registry keys to the following:
just update paths to where the yt-dlp.exe is located (to show proper icon in context menu) and where above .cmd file is. example below of registry keys needed.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\Open YouTube-DLP]
"icon"="\"C:\\Users\\username\\Scripts\\YouTube DL\\yt-dlp.exe\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\Open YouTube-DLP\command]
@="cmd.exe /k \"C:\\Users\\username\\Scripts\\YouTube DL\\DownloadRightClick.cmd\""
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
note, i need to detect when & is in the url (ie playlists) since it is an escapable character and requires a ^ in front of (ie youtube.com/url&playlist needs to be youtube.com/url^&playlist)
plan to update with basic logic later