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
import * as ResourceManifest from './messages/youtube/ResourceManifest.js'; | |
const appShellResponse = await fetch("https://www.youtube.com/app_shell", { | |
headers: { | |
"service-worker-navigation-preload": "true", | |
}, | |
method: "GET" | |
}); | |
if (!appShellResponse.ok) |
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
{ | |
"context":{ | |
"client":{ | |
"hl":"", | |
"gl":"", | |
"remoteHost":"1.2.3.4", | |
"deviceId":"", | |
"debugDeviceIdOverride":"", | |
"experimentIds":[ | |
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
import { Innertube, UniversalCache } from 'youtubei.js'; | |
(async () => { | |
const yt = await Innertube.create({ | |
cache: new UniversalCache(true) | |
}); | |
yt.session.on('auth-pending', (data) => { | |
console.log(`Go to ${data.verification_url} in your browser and enter code ${data.user_code} to authenticate.`); | |
}); |