Skip to content

Commit

Permalink
New macro: download YouTube video
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Andreas Zeitler committed Sep 11, 2015
1 parent 34c4022 commit 0994f0f
Showing 1 changed file with 355 additions and 0 deletions.
355 changes: 355 additions & 0 deletions Safari and Chrome/Download YouTube Video.kmmacros
@@ -0,0 +1,355 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>457084305.76405799</real>
<key>IsActive</key>
<false/>
<key>Macros</key>
<array>
<dict>
<key>Actions</key>
<array>
<dict>
<key>Buttons</key>
<array>
<dict>
<key>Button</key>
<string>OK</string>
</dict>
<dict>
<key>Button</key>
<string>Cancel</string>
<key>Cancel</key>
<true/>
</dict>
</array>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<true/>
<key>MacroActionType</key>
<string>PromptForUserInput</string>
<key>Prompt</key>
<string>Please enter the details for these variables.</string>
<key>TimeOutAbortsMacro</key>
<true/>
<key>Title</key>
<string>Video URL to download</string>
<key>Variables</key>
<array>
<dict>
<key>Default</key>
<string>%CurrentClipboard%</string>
<key>Variable</key>
<string>YTVideoURL</string>
</dict>
</array>
</dict>
<dict>
<key>ActionName</key>
<string>Delete Watch Later Parameters</string>
<key>Actions</key>
<array>
<dict>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<true/>
<key>MacroActionType</key>
<string>Comment</string>
<key>Text</key>
<string>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.</string>
<key>Title</key>
<string></string>
</dict>
<dict>
<key>Conditions</key>
<dict>
<key>ConditionList</key>
<array>
<dict>
<key>ConditionType</key>
<string>Variable</string>
<key>Variable</key>
<string>YTVideoURL</string>
<key>VariableConditionType</key>
<string>Contains</string>
<key>VariableValue</key>
<string>&amp;list=WL</string>
</dict>
</array>
<key>ConditionListMatch</key>
<string>All</string>
</dict>
<key>ElseActions</key>
<array/>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<true/>
<key>MacroActionType</key>
<string>IfThenElse</string>
<key>ThenActions</key>
<array>
<dict>
<key>Action</key>
<string>IgnoreCaseString</string>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<true/>
<key>MacroActionType</key>
<string>SearchReplaceVariable</string>
<key>Replace</key>
<string></string>
<key>Search</key>
<string>&amp;list=WL</string>
<key>Variable</key>
<string>YTVideoURL</string>
</dict>
</array>
<key>TimeOutAbortsMacro</key>
<true/>
</dict>
<dict>
<key>Conditions</key>
<dict>
<key>ConditionList</key>
<array>
<dict>
<key>ConditionType</key>
<string>Variable</string>
<key>Variable</key>
<string>YTVideoURL</string>
<key>VariableConditionType</key>
<string>Contains</string>
<key>VariableValue</key>
<string>&amp;list=WL</string>
</dict>
</array>
<key>ConditionListMatch</key>
<string>All</string>
</dict>
<key>ElseActions</key>
<array/>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<true/>
<key>MacroActionType</key>
<string>IfThenElse</string>
<key>ThenActions</key>
<array>
<dict>
<key>Action</key>
<string>IgnoreCaseString</string>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<true/>
<key>MacroActionType</key>
<string>SearchReplaceVariable</string>
<key>Replace</key>
<string></string>
<key>Search</key>
<string>&amp;list=WL</string>
<key>Variable</key>
<string>YTVideoURL</string>
</dict>
</array>
<key>TimeOutAbortsMacro</key>
<true/>
</dict>
</array>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<true/>
<key>MacroActionType</key>
<string>Group</string>
<key>TimeOutAbortsMacro</key>
<true/>
</dict>
<dict>
<key>ActionName</key>
<string>Download</string>
<key>Actions</key>
<array>
<dict>
<key>ActionName</key>
<string>Set YTVideoTitle variable</string>
<key>DisplayKind</key>
<string>Variable</string>
<key>IncludeStdErr</key>
<true/>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<false/>
<key>MacroActionType</key>
<string>ExecuteShellScript</string>
<key>Path</key>
<string></string>
<key>Text</key>
<string>echo `/usr/local/bin/youtube-dl --get-title $KMVAR_YTVideoURL`</string>
<key>TimeOutAbortsMacro</key>
<true/>
<key>TrimResults</key>
<false/>
<key>TrimResultsNew</key>
<false/>
<key>UseText</key>
<true/>
<key>Variable</key>
<string>YTVideoTitle</string>
</dict>
<dict>
<key>ActionName</key>
<string>Notify: download started</string>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<false/>
<key>MacroActionType</key>
<string>Notification</string>
<key>SoundName</key>
<string></string>
<key>Subtitle</key>
<string></string>
<key>Text</key>
<string>"%Variable%YTVideoTitle%" download started.</string>
<key>Title</key>
<string>%ExecutingMacro%</string>
</dict>
<dict>
<key>DisplayKind</key>
<string>Briefly</string>
<key>IncludeStdErr</key>
<true/>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<true/>
<key>MacroActionType</key>
<string>ExecuteShellScript</string>
<key>Path</key>
<string></string>
<key>Text</key>
<string>/usr/local/bin/youtube-dl --format mp4 --output "/Users/zettt/Downloads/%(uploader)s %(title)s.%(ext)s" --quiet $KMVAR_YTVideoURL</string>
<key>TimeOutAbortsMacro</key>
<true/>
<key>TrimResults</key>
<false/>
<key>TrimResultsNew</key>
<false/>
<key>UseText</key>
<true/>
</dict>
<dict>
<key>ActionName</key>
<string>Notify: download finished</string>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<false/>
<key>MacroActionType</key>
<string>Notification</string>
<key>SoundName</key>
<string></string>
<key>Subtitle</key>
<string></string>
<key>Text</key>
<string>"%Variable%YTVideoTitle%" download finished.</string>
<key>Title</key>
<string>%ExecutingMacro%</string>
</dict>
</array>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<true/>
<key>MacroActionType</key>
<string>Group</string>
<key>TimeOutAbortsMacro</key>
<true/>
</dict>
<dict>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<false/>
<key>MacroActionType</key>
<string>Comment</string>
<key>Text</key>
<string></string>
<key>Title</key>
<string>Delete Variables</string>
</dict>
<dict>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<false/>
<key>MacroActionType</key>
<string>SetVariableToText</string>
<key>Text</key>
<string>%Delete%</string>
<key>Variable</key>
<string>YTVideoURL</string>
</dict>
<dict>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<false/>
<key>MacroActionType</key>
<string>SetVariableToText</string>
<key>Text</key>
<string>%Delete%</string>
<key>Variable</key>
<string>YTVideoTitle</string>
</dict>
</array>
<key>CreationDate</key>
<real>463645838.55652499</real>
<key>IsActive</key>
<true/>
<key>ModificationDate</key>
<real>463646094.27191103</real>
<key>Name</key>
<string>Download YouTube Video</string>
<key>Triggers</key>
<array>
<dict>
<key>MacroTriggerType</key>
<string>StatusMenu</string>
</dict>
<dict>
<key>FireType</key>
<string>Pressed</string>
<key>KeyCode</key>
<integer>111</integer>
<key>MacroTriggerType</key>
<string>HotKey</string>
<key>Modifiers</key>
<integer>4096</integer>
</dict>
</array>
<key>UID</key>
<string>8630E290-D5B3-453D-AA0E-214260D37179</string>
</dict>
</array>
<key>Name</key>
<string>Keyboard Maestro Macros Repo</string>
<key>ToggleMacroUID</key>
<string>A1860A09-07B6-4605-BC7A-BB50A815DB46</string>
<key>UID</key>
<string>FDC52ACB-F36A-424D-8746-FA279F0A39A9</string>
</dict>
</array>
</plist>

0 comments on commit 0994f0f

Please sign in to comment.