diff options
author | anekos | 2010-05-07 16:48:18 +0000 |
---|---|---|
committer | anekos | 2010-05-07 16:48:18 +0000 |
commit | 1d69bec9d9f528f55928659886cc8d9657e5f0fa (patch) | |
tree | 2c7cdba059043cadd925fbf9f36ca6eb157f24c2 /stella.js | |
parent | 357a0dafc75ee396d12c32374c08724cb0801c25 (diff) | |
download | vimperator-plugins-1d69bec9d9f528f55928659886cc8d9657e5f0fa.tar.bz2 |
Meow Meow Change!
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37418 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'stella.js')
-rw-r--r-- | stella.js | 23 |
1 files changed, 16 insertions, 7 deletions
@@ -1007,11 +1007,25 @@ Thanks: set volume (value) (this.player.setVolume(value), this.volume), fetch: function (filepath) { + function _fetch (id, t) { + let url = + "http://youtube.com/get_video?video_id=" + id + + "&t=" + decodeURIComponent(t) + + (quality ? "&fmt=" + quality : ''); + U.download(url, filepath, '.flv', self.title); + } + let self = this; + let id = YouTubePlayer.getIDfromURL(U.currentURL); // all(1080p,720p,480p,360p) -> 37, 22, 35, 34, 5 // FIXME 一番初めが最高画質だと期待 - let quality = content.wrappedJSObject.yt.config_.SWF_CONFIG.args.fmt_map.match(/^\d+/); + let cargs = content.wrappedJSObject.yt.config_.SWF_CONFIG.args + let quality = cargs.fmt_map.match(/^\d+/); + let t = cargs.t; + + // 時間が経っていると無効化されてしまっている + //_fetch(t, id); U.httpRequest( U.currentURL, @@ -1019,12 +1033,7 @@ Thanks: function (xhr) { // XXX t が変わるために、キャッシュを利用できない問題アリアリアリアリ let [, t] = xhr.responseText.match(/swfHTML.*&t=([^&]+)/); - let id = YouTubePlayer.getIDfromURL(U.currentURL); - let url = - "http://youtube.com/get_video?video_id=" + id + - "&t=" + decodeURIComponent(t) + - (quality ? "&fmt=" + quality : ''); - U.download(url, filepath, '.flv', self.title); + _fetch(id, t); } ); }, |