Skip to content

Instantly share code, notes, and snippets.

@mfilej
Created February 6, 2015 21:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfilej/7733bfc0189037e5e2c8 to your computer and use it in GitHub Desktop.
Save mfilej/7733bfc0189037e5e2c8 to your computer and use it in GitHub Desktop.
Open YouTube video in current tab with QuickTime
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