Created
February 6, 2015 21:54
-
-
Save mfilej/7733bfc0189037e5e2c8 to your computer and use it in GitHub Desktop.
Open YouTube video in current tab with QuickTime
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
tell application "Safari" | |
set youtubeURL to URL of current tab of window 1 | |
end tell | |
-- set format to item 1 of (choose from list {"22/18", "18"}) | |
set format to "22/18" | |
set youtubeCmd to "/usr/local/bin/youtube-dl -g -f " & format & " --no-playlist '" & youtubeURL & "'" | |
set videoURL to do shell script youtubeCmd | |
tell application "QuickTime Player" to open URL videoURL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment