From 0994f0f30e381c4c4090eabc2b6667dcdf628dd1 Mon Sep 17 00:00:00 2001 From: Andreas Zeitler Date: Fri, 11 Sep 2015 08:37:13 +0200 Subject: [PATCH] New macro: download YouTube video After this macro is activated, it displays a prompt containing your current clipboard. (Maybe you have the YouTube URL already on your clipboard?) It will use youtube-dl to download the video in 720p. --- .../Download YouTube Video.kmmacros | 355 ++++++++++++++++++ 1 file changed, 355 insertions(+) create mode 100644 Safari and Chrome/Download YouTube Video.kmmacros diff --git a/Safari and Chrome/Download YouTube Video.kmmacros b/Safari and Chrome/Download YouTube Video.kmmacros new file mode 100644 index 0000000..7742718 --- /dev/null +++ b/Safari and Chrome/Download YouTube Video.kmmacros @@ -0,0 +1,355 @@ + + + + + + Activate + Normal + CreationDate + 457084305.76405799 + IsActive + + Macros + + + Actions + + + Buttons + + + Button + OK + + + Button + Cancel + Cancel + + + + IsActive + + IsDisclosed + + MacroActionType + PromptForUserInput + Prompt + Please enter the details for these variables. + TimeOutAbortsMacro + + Title + Video URL to download + Variables + + + Default + %CurrentClipboard% + Variable + YTVideoURL + + + + + ActionName + Delete Watch Later Parameters + Actions + + + IsActive + + IsDisclosed + + MacroActionType + Comment + Text + If you experience problems with this macro please try to replace the variables here with *your* actual list (Watch Later) or some other playlist' ID's here. youtube-dl doesn't work so well with those. + Title + + + + Conditions + + ConditionList + + + ConditionType + Variable + Variable + YTVideoURL + VariableConditionType + Contains + VariableValue + &list=WL + + + ConditionListMatch + All + + ElseActions + + IsActive + + IsDisclosed + + MacroActionType + IfThenElse + ThenActions + + + Action + IgnoreCaseString + IsActive + + IsDisclosed + + MacroActionType + SearchReplaceVariable + Replace + + Search + &list=WL + Variable + YTVideoURL + + + TimeOutAbortsMacro + + + + Conditions + + ConditionList + + + ConditionType + Variable + Variable + YTVideoURL + VariableConditionType + Contains + VariableValue + &list=WL + + + ConditionListMatch + All + + ElseActions + + IsActive + + IsDisclosed + + MacroActionType + IfThenElse + ThenActions + + + Action + IgnoreCaseString + IsActive + + IsDisclosed + + MacroActionType + SearchReplaceVariable + Replace + + Search + &list=WL + Variable + YTVideoURL + + + TimeOutAbortsMacro + + + + IsActive + + IsDisclosed + + MacroActionType + Group + TimeOutAbortsMacro + + + + ActionName + Download + Actions + + + ActionName + Set YTVideoTitle variable + DisplayKind + Variable + IncludeStdErr + + IsActive + + IsDisclosed + + MacroActionType + ExecuteShellScript + Path + + Text + echo `/usr/local/bin/youtube-dl --get-title $KMVAR_YTVideoURL` + TimeOutAbortsMacro + + TrimResults + + TrimResultsNew + + UseText + + Variable + YTVideoTitle + + + ActionName + Notify: download started + IsActive + + IsDisclosed + + MacroActionType + Notification + SoundName + + Subtitle + + Text + "%Variable%YTVideoTitle%" download started. + Title + %ExecutingMacro% + + + DisplayKind + Briefly + IncludeStdErr + + IsActive + + IsDisclosed + + MacroActionType + ExecuteShellScript + Path + + Text + /usr/local/bin/youtube-dl --format mp4 --output "/Users/zettt/Downloads/%(uploader)s %(title)s.%(ext)s" --quiet $KMVAR_YTVideoURL + TimeOutAbortsMacro + + TrimResults + + TrimResultsNew + + UseText + + + + ActionName + Notify: download finished + IsActive + + IsDisclosed + + MacroActionType + Notification + SoundName + + Subtitle + + Text + "%Variable%YTVideoTitle%" download finished. + Title + %ExecutingMacro% + + + IsActive + + IsDisclosed + + MacroActionType + Group + TimeOutAbortsMacro + + + + IsActive + + IsDisclosed + + MacroActionType + Comment + Text + + Title + Delete Variables + + + IsActive + + IsDisclosed + + MacroActionType + SetVariableToText + Text + %Delete% + Variable + YTVideoURL + + + IsActive + + IsDisclosed + + MacroActionType + SetVariableToText + Text + %Delete% + Variable + YTVideoTitle + + + CreationDate + 463645838.55652499 + IsActive + + ModificationDate + 463646094.27191103 + Name + Download YouTube Video + Triggers + + + MacroTriggerType + StatusMenu + + + FireType + Pressed + KeyCode + 111 + MacroTriggerType + HotKey + Modifiers + 4096 + + + UID + 8630E290-D5B3-453D-AA0E-214260D37179 + + + Name + Keyboard Maestro Macros Repo + ToggleMacroUID + A1860A09-07B6-4605-BC7A-BB50A815DB46 + UID + FDC52ACB-F36A-424D-8746-FA279F0A39A9 + + +