Skip to content

Instantly share code, notes, and snippets.

@czenzel
Last active March 7, 2018 05:18
Show Gist options
  • Save czenzel/1f793dad3a1b6839f4d384ea6bd2c1a3 to your computer and use it in GitHub Desktop.
Save czenzel/1f793dad3a1b6839f4d384ea6bd2c1a3 to your computer and use it in GitHub Desktop.
Youtube Internet Search - Download Video within Page
// 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