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
(async () => { | |
const html = await fetch(window.location.href).then((resp) => resp.text()).then((text) => text); | |
const startStr = 'ytplayer.config = {'; | |
const start = html.indexOf(startStr) + startStr.length - 1; | |
const end = html.indexOf('};', start) + 1; | |
const playerObj = JSON.parse(html.slice(start, end)); | |
playerObj.args.player_response = JSON.parse(playerObj.args.player_response); | |
const videoUrls = playerObj.args.player_response.streamingData.adaptiveFormats.reduce((acc, item) => { |
OlderNewer