mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
fix(downloader): update youtubei.js and remove player_id (#4069)
This commit is contained in:
@ -134,7 +134,7 @@
|
||||
"virtua": "0.42.3",
|
||||
"vudio": "2.1.1",
|
||||
"x11": "2.3.0",
|
||||
"youtubei.js": "15.0.1",
|
||||
"youtubei.js": "^16.0.1",
|
||||
"zod": "4.1.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
41
pnpm-lock.yaml
generated
41
pnpm-lock.yaml
generated
@ -250,8 +250,8 @@ importers:
|
||||
specifier: 2.3.0
|
||||
version: 2.3.0
|
||||
youtubei.js:
|
||||
specifier: 15.0.1
|
||||
version: 15.0.1
|
||||
specifier: ^16.0.1
|
||||
version: 16.0.1
|
||||
zod:
|
||||
specifier: 4.1.5
|
||||
version: 4.1.5
|
||||
@ -482,8 +482,8 @@ packages:
|
||||
resolution: {integrity: sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
|
||||
'@bufbuild/protobuf@2.6.3':
|
||||
resolution: {integrity: sha512-w/gJKME9mYN7ZoUAmSMAWXk4hkVpxRKvEJCb3dV5g9wwWdxTJJ0ayOJAVcNxtdqaxDyFuC0uz4RSGVacJ030PQ==}
|
||||
'@bufbuild/protobuf@2.10.0':
|
||||
resolution: {integrity: sha512-fdRs9PSrBF7QUntpZpq6BTw58fhgGJojgg39m9oFOJGZT+nip9b0so5cYY1oWl5pvemDLr0cPPsH46vwThEbpQ==}
|
||||
|
||||
'@dehoist/romanize-thai@1.0.0':
|
||||
resolution: {integrity: sha512-6SqD4vyZ48otnypLXMh901CeQetoP5ptYOaIr58N6zDqjjoN0bHszMb5d/6AXJJQf8kIvbmSWBeuDrbAWLajPQ==}
|
||||
@ -2571,6 +2571,9 @@ packages:
|
||||
exponential-backoff@3.1.2:
|
||||
resolution: {integrity: sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA==}
|
||||
|
||||
exponential-backoff@3.1.3:
|
||||
resolution: {integrity: sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==}
|
||||
|
||||
extract-zip@2.0.1:
|
||||
resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==}
|
||||
engines: {node: '>= 10.17.0'}
|
||||
@ -3214,9 +3217,6 @@ packages:
|
||||
resolution: {integrity: sha512-YcwCHw1kiqEeI5xRpDlPPBGL2EOpBKLwO4yIBJcXWHPj5PnA5urGq0jbyhM5KoNpypQ6VboSoxc9D8HyfvngSg==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
jintr@3.3.1:
|
||||
resolution: {integrity: sha512-nnOzyhf0SLpbWuZ270Omwbj5LcXUkTcZkVnK8/veJXtSZOiATM5gMZMdmzN75FmTyj+NVgrGaPdH12zIJ24oIA==}
|
||||
|
||||
jpeg-js@0.4.4:
|
||||
resolution: {integrity: sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==}
|
||||
|
||||
@ -3480,6 +3480,10 @@ packages:
|
||||
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
meriyah@6.1.4:
|
||||
resolution: {integrity: sha512-Sz8FzjzI0kN13GK/6MVEsVzMZEPvOhnmmI1lU5+/1cGOiK3QUahntrNNtdVeihrO7t9JpoH75iMNXg6R6uWflQ==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
|
||||
micromatch@4.0.8:
|
||||
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
|
||||
engines: {node: '>=8.6'}
|
||||
@ -4875,8 +4879,8 @@ packages:
|
||||
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
youtubei.js@15.0.1:
|
||||
resolution: {integrity: sha512-2slapqJS5NuXKHvcACEknyVz0AjH/TrXaOhDM0q2twQKa54kCmfj+7B/2nGfd20uzAe29zW1ejk2qOc4ABuGkg==}
|
||||
youtubei.js@16.0.1:
|
||||
resolution: {integrity: sha512-3802bCAGkBc2/G5WUTc0l/bO5mPYJbQAHL04d9hE9PnrDHoBUT8MN721Yqt4RCNncAXdHcfee9VdJy3Fhq1r5g==}
|
||||
|
||||
zlibjs@0.3.1:
|
||||
resolution: {integrity: sha512-+J9RrgTKOmlxFSDHo0pI1xM6BLVUv+o0ZT9ANtCxGkjIVCCUdx9alUF8Gm+dGLKbkkkidWIHFDZHDMpfITt4+w==}
|
||||
@ -5021,7 +5025,7 @@ snapshots:
|
||||
'@babel/helper-string-parser': 7.27.1
|
||||
'@babel/helper-validator-identifier': 7.27.1
|
||||
|
||||
'@bufbuild/protobuf@2.6.3': {}
|
||||
'@bufbuild/protobuf@2.10.0': {}
|
||||
|
||||
'@dehoist/romanize-thai@1.0.0': {}
|
||||
|
||||
@ -5091,7 +5095,7 @@ snapshots:
|
||||
'@electron/node-gyp@https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2':
|
||||
dependencies:
|
||||
env-paths: 2.2.1
|
||||
exponential-backoff: 3.1.2
|
||||
exponential-backoff: 3.1.3
|
||||
glob: 8.1.0
|
||||
graceful-fs: 4.2.11
|
||||
make-fetch-happen: 10.2.1
|
||||
@ -7505,6 +7509,8 @@ snapshots:
|
||||
|
||||
exponential-backoff@3.1.2: {}
|
||||
|
||||
exponential-backoff@3.1.3: {}
|
||||
|
||||
extract-zip@2.0.1:
|
||||
dependencies:
|
||||
debug: 4.4.1
|
||||
@ -8200,10 +8206,6 @@ snapshots:
|
||||
'@jimp/types': 1.6.0
|
||||
'@jimp/utils': 1.6.0
|
||||
|
||||
jintr@3.3.1:
|
||||
dependencies:
|
||||
acorn: 8.15.0
|
||||
|
||||
jpeg-js@0.4.4: {}
|
||||
|
||||
js-tokens@4.0.0: {}
|
||||
@ -8470,6 +8472,8 @@ snapshots:
|
||||
|
||||
merge2@1.4.1: {}
|
||||
|
||||
meriyah@6.1.4: {}
|
||||
|
||||
micromatch@4.0.8:
|
||||
dependencies:
|
||||
braces: 3.0.3
|
||||
@ -9904,11 +9908,10 @@ snapshots:
|
||||
|
||||
yocto-queue@0.1.0: {}
|
||||
|
||||
youtubei.js@15.0.1:
|
||||
youtubei.js@16.0.1:
|
||||
dependencies:
|
||||
'@bufbuild/protobuf': 2.6.3
|
||||
jintr: 3.3.1
|
||||
undici: 6.21.3
|
||||
'@bufbuild/protobuf': 2.10.0
|
||||
meriyah: 6.1.4
|
||||
|
||||
zlibjs@0.3.1: {}
|
||||
|
||||
|
||||
@ -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