aboutsummaryrefslogtreecommitdiffstats
path: root/stella.js
diff options
context:
space:
mode:
authoranekos2010-05-06 14:24:45 +0000
committeranekos2010-05-06 14:24:45 +0000
commit357a0dafc75ee396d12c32374c08724cb0801c25 (patch)
treeaa57a3c614a32ef6639263fc00f83b34a0421e86 /stella.js
parentfb448617719bec7e503908c626688fd403e4fe7b (diff)
downloadvimperator-plugins-357a0dafc75ee396d12c32374c08724cb0801c25.tar.bz2
YouTube で(たぶん)最高画質の動画をダウンロードできるようにした
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37407 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'stella.js')
-rw-r--r--stella.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/stella.js b/stella.js
index c9dd609..4d6b233 100644
--- a/stella.js
+++ b/stella.js
@@ -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.29.0</version>
+ <version>0.30.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>
@@ -1009,6 +1009,10 @@ Thanks:
fetch: function (filepath) {
let self = this;
+ // all(1080p,720p,480p,360p) -> 37, 22, 35, 34, 5
+ // FIXME 一番初めが最高画質だと期待
+ let quality = content.wrappedJSObject.yt.config_.SWF_CONFIG.args.fmt_map.match(/^\d+/);
+
U.httpRequest(
U.currentURL,
null,
@@ -1016,7 +1020,10 @@ Thanks:
// 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);
+ let url =
+ "http://youtube.com/get_video?video_id=" + id +
+ "&t=" + decodeURIComponent(t) +
+ (quality ? "&fmt=" + quality : '');
U.download(url, filepath, '.flv', self.title);
}
);