Skip to content

Instantly share code, notes, and snippets.

@eagletmt
Created August 6, 2011 19:16
Show Gist options
  • Save eagletmt/1129653 to your computer and use it in GitHub Desktop.
Save eagletmt/1129653 to your computer and use it in GitHub Desktop.
diff --git a/stella.js b/stella.js
index 6b476cd..63f7b9e 100644
--- a/stella.js
+++ b/stella.js
@@ -967,8 +967,12 @@ Thanks:
// all(1080p,720p,480p,360p) -> 37, 22, 35, 34, 5
// FIXME 一番初めが最高画質だと期待
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);
+ cargs.url_encoded_fmt_stream_map.split(',')[0].split('&').forEach(function(x) {
+ let [key, val] = x.split('=');
+ if (key == 'url') {
+ U.download(decodeURIComponent(val), filepath, '.flv', this.title);
+ }
+ });
},
makeURL: function (value, type) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment