Skip to content

Instantly share code, notes, and snippets.

View LuanRT's full-sized avatar
💭
Thinking..

Luan LuanRT

💭
Thinking..
View GitHub Profile
@LuanRT
LuanRT / main.ts
Created June 16, 2023 21:14
YouTube.js `/analytics_data/join` endpoint example
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.`);
});
@LuanRT
LuanRT / innertube-full-context.json
Created June 16, 2024 17:38
Extracted from the Android app (v18.18.38), this includes all possible fields that clients might use, as well as debugging fields that aren't used at all.
{
"context":{
"client":{
"hl":"",
"gl":"",
"remoteHost":"1.2.3.4",
"deviceId":"",
"debugDeviceIdOverride":"",
"experimentIds":[
@LuanRT
LuanRT / main.ts
Last active July 1, 2024 03:35
Getting YouTube's script & css URLs from `/app_shell`
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)