mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
fix(downloader): update youtubei.js and remove player_id (#4069)
This commit is contained in:
@ -8,6 +8,7 @@ import {
|
||||
UniversalCache,
|
||||
Utils,
|
||||
YTNodes,
|
||||
Platform,
|
||||
} from '\u0079\u006f\u0075\u0074\u0075\u0062\u0065i.js';
|
||||
import is from 'electron-is';
|
||||
import filenamify from 'filenamify';
|
||||
@ -57,6 +58,22 @@ const ffmpeg = lazy(async () =>
|
||||
);
|
||||
const ffmpegMutex = new Mutex();
|
||||
|
||||
Platform.shim.eval = async (data: Types.BuildScriptResult, env: Record<string, Types.VMPrimative>) => {
|
||||
const properties = [];
|
||||
|
||||
if(env.n) {
|
||||
properties.push(`n: exportedVars.nFunction("${env.n}")`)
|
||||
}
|
||||
|
||||
if (env.sig) {
|
||||
properties.push(`sig: exportedVars.sigFunction("${env.sig}")`)
|
||||
}
|
||||
|
||||
const code = `${data.output}\nreturn { ${properties.join(', ')} }`;
|
||||
|
||||
return new Function(code)();
|
||||
}
|
||||
|
||||
let yt: Innertube;
|
||||
let win: BrowserWindow;
|
||||
let playingUrl: string;
|
||||
@ -131,7 +148,6 @@ export const onMainLoad = async ({
|
||||
|
||||
yt = await Innertube.create({
|
||||
cache: new UniversalCache(false),
|
||||
player_id: '0004de42',
|
||||
cookie: await getCookieFromWindow(win),
|
||||
generate_session_locally: true,
|
||||
fetch: getNetFetchAsFetch(),
|
||||
|
||||
Reference in New Issue
Block a user