From ef15e71cf5b97c956da9cc8c561b47ac99407e37 Mon Sep 17 00:00:00 2001 From: anekos Date: Thu, 6 May 2010 11:35:37 +0000 Subject: YouTube の保存対応 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37395 d0d07461-0603-4401-acd4-de1884942a52 --- stella.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'stella.js') diff --git a/stella.js b/stella.js index b6da4ea..6ed61ad 100644 --- a/stella.js +++ b/stella.js @@ -39,7 +39,7 @@ let PLUGIN_INFO = すてら For Niconico/YouTube/Vimeo, Add control commands and information display(on status line). ニコニコ動画/YouTube/Vimeo 用。操作コマンドと情報表示(ステータスライン上に)追加します。 - 0.28.0 + 0.29.0 anekos new BSD License (Please read the source code comments of this plugin) 修正BSDライセンス (ソースコードのコメントを参照してください) @@ -844,6 +844,7 @@ Thanks: functions: { currentTime: 'rw', + fetch: 'x', fileURL: 'r', fullscreen: 'rwt', makeURL: 'x', @@ -995,6 +996,21 @@ Thanks: get volume () parseInt(this.player.getVolume()), set volume (value) (this.player.setVolume(value), this.volume), + fetch: function (filepath) { + let self = this; + + U.httpRequest( + buffer.URL, + null, + function (xhr) { + let [, t] = xhr.responseText.match(/swfHTML.*&t=([^&]+)/); + let id = YouTubePlayer.getIDfromURL(buffer.URL); + let url = "http://youtube.com/get_video?video_id=" + id + "&t=" + decodeURIComponent(t); + U.download(url, filepath, '.flv', self.title); + } + ); + }, + makeURL: function (value, type) { switch (type) { case Player.URL_ID: -- cgit v1.2.3