Created
November 15, 2010 04:33
-
-
Save wilson/700032 to your computer and use it in GitHub Desktop.
Download the current youtube page in the background
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
" This gets added to your vimperatorrc; makes ':yt' trigger youtube-dl | |
" You can also bind it directly to a keystroke. | |
" Requires youtube-dl: https://github.com/rg3/youtube-dl | |
" On a Mac with Homebrew installed, you can 'brew install youtube-dl' | |
comm! yt 'exe "!" + eval("plugins.youtubeDownload.youtubeDownload()")' |
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
// This goes in ~/.vimperator/plugin/youtubeDownload.js | |
function youtubeDownload() { | |
if (!/youtube/.test(buffer.URL)) { | |
return "echo Not a Youtube URL"; | |
} | |
var cmd = "cd ~/Movies && youtube-dl -t "; | |
var url = "'" + buffer.URL + "'"; | |
var cmd_string = cmd + url + " & ; open -g ~/Movies"; | |
return cmd_string; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment