Skip to content

Instantly share code, notes, and snippets.

@J-Broadway
Last active April 5, 2020 16:55
Show Gist options
  • Save J-Broadway/a50d952b0f8458c4aa02f7881d65656b to your computer and use it in GitHub Desktop.
Save J-Broadway/a50d952b0f8458c4aa02f7881d65656b to your computer and use it in GitHub Desktop.
youtube-dl batch
@echo off
::Change directory below to point to your youtube-dl folder
cd "C:\Users\%USERNAME%\Downloads\youtube-dl"
setlocal EnableDelayedExpansion
set "input="
set "p-start="
set "p-end="
::Download media as wav if -a flag is used
IF "%1"=="-a" (
set /p input=Media URL:
youtube-dl -x --audio-format wav !input!
exit /b
)
::Download playlist from start to end as wav if -p flag is used
IF "%1"=="-p" (
set /p input=Media URL:
set /p p-start=Playlist-Start:
set /p p-end=Playlist-End:
youtube-dl -x --audio-format wav --playlist-start !p-start! --playlist-end !p-end! !input!
exit /b
)
::If -a flag isn't used execute youtube-dl and pass all arguments
youtube-dl %*
# Remove output
-o '%(title)s.%(ext)s'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment