Skip to content

Instantly share code, notes, and snippets.

@mdavey
Created June 28, 2015 09:07
Show Gist options
  • Save mdavey/71a6b4eb3b919d3ac669 to your computer and use it in GitHub Desktop.
Save mdavey/71a6b4eb3b919d3ac669 to your computer and use it in GitHub Desktop.
@echo off
call :inputbox "Video ID" "Download Youtube video as MP3"
youtube-dl.exe -x --audio-format mp3 https://www.youtube.com/watch?v=%input%
exit /b
:InputBox
set input=
set heading=%~2
set message=%~1
echo wscript.echo inputbox(WScript.Arguments(0),WScript.Arguments(1)) >"%temp%\input.vbs"
for /f "tokens=* delims=" %%a in ('cscript //nologo "%temp%\input.vbs" "%message%" "%heading%"') do set input=%%a
exit /b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment