aboutsummaryrefslogtreecommitdiffstats
path: root/stella.js
diff options
context:
space:
mode:
authoranekos2011-05-01 00:18:54 +0900
committeranekos2011-05-01 00:18:54 +0900
commita866423c3534f8635316e55b88316403a6aef1b1 (patch)
treec1a46bc3cbe5a716754e936a96dc3509ff815ae3 /stella.js
parentc3cf4a117499bed69961bfd5e731e0350f4c62cd (diff)
downloadvimperator-plugins-a866423c3534f8635316e55b88316403a6aef1b1.tar.bz2
Fix: fetch on youtube.
Thanks, eagletmt. https://gist.github.com/949731
Diffstat (limited to 'stella.js')
-rw-r--r--stella.js30
1 files changed, 3 insertions, 27 deletions
diff --git a/stella.js b/stella.js
index c6b87a0..ad82531 100644
--- a/stella.js
+++ b/stella.js
@@ -964,35 +964,11 @@ 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;
-
// all(1080p,720p,480p,360p) -> 37, 22, 35, 34, 5
// FIXME 一番初めが最高画質だと期待
- let cargs = content.wrappedJSObject.yt.config_.SWF_CONFIG.args;
- let quality = cargs.fmt_map.match(/^\d+/);
- let t = cargs.t;
- let id = this.id;
-
- // 時間が経っていると無効化されてしまっている
- //_fetch(t, id);
-
- U.httpRequest(
- U.currentURL,
- null,
- function (xhr) {
- // XXX t が変わるために、キャッシュを利用できない問題アリアリアリアリ
- let [, t] = xhr.responseText.match(/swfHTML.*&t=([^&]+)/);
- _fetch(id, t);
- }
- );
+ let cargs = content.wrappedJSObject.yt.config_.PLAYER_CONFIG.args;
+ let url = decodeURIComponent(cargs.fmt_url_map.split(',')[0].split('|')[1]);
+ U.download(url, filepath, '.flv', this.title);
},
makeURL: function (value, type) {