diff options
author | anekos | 2010-05-06 11:35:37 +0000 |
---|---|---|
committer | anekos | 2010-05-06 11:35:37 +0000 |
commit | ef15e71cf5b97c956da9cc8c561b47ac99407e37 (patch) | |
tree | efc7f87b9cd29826ed6e6b0bf7bfde5037f0b44b | |
parent | 46bbfce6a7594dd7fba82c0246d8b00d488cdcd4 (diff) | |
download | vimperator-plugins-ef15e71cf5b97c956da9cc8c561b47ac99407e37.tar.bz2 |
YouTube の保存対応
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37395 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r-- | stella.js | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -39,7 +39,7 @@ let PLUGIN_INFO = <name lang="ja">すてら</name> <description>For Niconico/YouTube/Vimeo, Add control commands and information display(on status line).</description> <description lang="ja">ニコニコ動画/YouTube/Vimeo 用。操作コマンドと情報表示(ステータスライン上に)追加します。</description> - <version>0.28.0</version> + <version>0.29.0</version> <author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author> <license>new BSD License (Please read the source code comments of this plugin)</license> <license lang="ja">修正BSDライセンス (ソースコードのコメントを参照してください)</license> @@ -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: |