Last active
December 14, 2015 13:08
-
-
Save m1el/5091478 to your computer and use it in GitHub Desktop.
youtube dl links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fmt_map = ytplayer.config.args.url_encoded_fmt_stream_map.split(',').map (e) -> | |
e.split('&').reduce (p, c) -> | |
c = c.split('=') | |
p[c[0]] = unescape(c[1]) | |
p | |
, {} | |
dl_map = fmt_map.reduce (p, c) -> | |
p["#{c.quality}/#{c.type}"] = "#{c.url}&signature=#{c.sig}" | |
p | |
, {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get download links for youtube | |
var fmt_map = ytplayer.config.args.url_encoded_fmt_stream_map.split(',').map(function(e) { | |
return e.split('&').reduce(function(p, c) { | |
c = c.split(/[=]/); | |
p[c[0]] = unescape(c[1]); | |
return p; | |
}, {}); | |
}), | |
dl_map = fmt_map.reduce(function(p, c) { | |
p[c.quality + '/' + c.type] = c.url + '&signature=' + c.sig; | |
return p; | |
}, {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment