Created
February 22, 2020 15:16
-
-
Save elig0n/e318ac950b71c26a21745d341d29d6ae to your computer and use it in GitHub Desktop.
youtube-dl autohotkey dialog
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
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