Forked from geuis/gist:8b1b2ea57d7f9a9ae22f80d4fbf5b97f
Created
June 27, 2016 11:14
-
-
Save narcotx/9547f8852cf6bddb851394b1a0500086 to your computer and use it in GitHub Desktop.
Get Youtube video urls
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
// Run from the dev tools console of any Youtube video | |
// Accurate as of June 12, 2016 | |
var videoUrls = {}; | |
ytplayer.config.args.url_encoded_fmt_stream_map.split(',').forEach(function (item) { | |
var obj = {}; | |
item.split('&').forEach(function (param) { | |
param = param.split('='); | |
obj[param[0]] = decodeURIComponent(param[1]); | |
}); | |
videoUrls[obj.quality] = obj; | |
}); | |
console.log(videoUrls); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it works and then it doesn't work :/