Skip to content

Instantly share code, notes, and snippets.

@shanept
Created September 16, 2022 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shanept/a3df7211bb866abf21639ecf4f72995e to your computer and use it in GitHub Desktop.
Save shanept/a3df7211bb866abf21639ecf4f72995e to your computer and use it in GitHub Desktop.
(function() {
var formats = ytplayer.config.args.raw_player_response.streamingData.adaptiveFormats;
formats.sort(function(a, b) {
if (a.width > b.width) return -1;
if (a.width < b.width) return +1;
return 0;
});
window.open(formats[0].url);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment