Created
April 14, 2021 03:36
-
-
Save nicebyte/c87b6623e1932bf6a18406d4dfb09caa to your computer and use it in GitHub Desktop.
Authohotkey script to download audio from the youtube video in the current tab.
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
; Extracts audio from the youtube video in the current tab. | |
; Requires youtube-dl and ffmpeg. | |
; Download location. | |
DownloadDir := "d:\\music\\dump" | |
; Hotkey that triggers the script (Win+Z). | |
#Z:: | |
ClipSaved:=ClipboardAll | |
Clipboard= | |
Sleep 100 | |
Send ^l^c | |
ClipWait 0.1 | |
url:=Clipboard | |
Clipboard:=ClipSaved | |
ClipSaved= | |
is_yt := RegexMatch(url, "youtube\.com\/watch") | |
if (is_yt > 0) { | |
prefix := "youtube-dl --extract-audio --embed-thumbnail --audio-quality 0 --audio-format mp3" | |
RunWait %ComSpec% /c %prefix% %url%, %DownloadDir% | |
} else { | |
MsgBox, 16, "youtube-dl", "That is not a youtube video" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment