Skip to content

Instantly share code, notes, and snippets.

@elig0n
Created February 22, 2020 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elig0n/e318ac950b71c26a21745d341d29d6ae to your computer and use it in GitHub Desktop.
Save elig0n/e318ac950b71c26a21745d341d29d6ae to your computer and use it in GitHub Desktop.
youtube-dl autohotkey dialog
Gui, YTDL:New, , Youtube-DL
Gui, Add, Edit, Section R1 W400 vUrl, URL
Gui, Add, Checkbox, ys+3 vAudio, Audio
Gui, Add, Button, xs+ Section w80 gOK, &OK
Gui, Add, Button, ys w80 gGuiClose, &Cancel
Gui, Show
Return
GuiClose:
GuiEscape:
Gui, Destroy
Return
OK:
Gui, Submit
if (Audio = 1) {
audio_options := "-x --audio-format mp3"
RunWait, youtube-dl %audio_options% "%Url%" -o "D:\Music\`%(title)s`-`%(id)s`.`%(ext)s`", , UseErrorLevel
}
else {
video_options := ""
RunWait, youtube-dl %video_options% "%Url%" -o "E:\Videos\`%(title)s`-`%(id)s`.`%(ext)s`", , UseErrorLevel
}
if (ErrorLevel = 1) {
MsgBox, youtube-dl: Error occurred (exit code: %ErrorLevel%)
}
Return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment