mirror of
https://github.com/imputnet/cobalt.git
synced 2026-04-23 10:18:15 +00:00
api: bump youtubei.js to 17.0.1
This commit is contained in:
parent
c5d89296c3
commit
25df76ed7c
@ -40,7 +40,7 @@
|
|||||||
"set-cookie-parser": "2.7.2",
|
"set-cookie-parser": "2.7.2",
|
||||||
"undici": "^6.22.0",
|
"undici": "^6.22.0",
|
||||||
"url-pattern": "1.0.3",
|
"url-pattern": "1.0.3",
|
||||||
"youtubei.js": "16.0.1",
|
"youtubei.js": "17.0.1",
|
||||||
"zod": "^4.2.1"
|
"zod": "^4.2.1"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
|
|||||||
@ -9,24 +9,12 @@ import { getCookie } from "../cookie/manager.js";
|
|||||||
import { getYouTubeSession } from "../helpers/youtube-session.js";
|
import { getYouTubeSession } from "../helpers/youtube-session.js";
|
||||||
|
|
||||||
// https://github.com/LuanRT/YouTube.js/pull/1052
|
// https://github.com/LuanRT/YouTube.js/pull/1052
|
||||||
Platform.shim.eval = async (data, envData) => {
|
Platform.shim.eval = async (data) => {
|
||||||
const isolate = new ivm.Isolate();
|
const isolate = new ivm.Isolate();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const context = await isolate.createContext();
|
const context = await isolate.createContext();
|
||||||
const jail = context.global;
|
const code = `(() => { ${data.output} })()`;
|
||||||
const properties = [];
|
|
||||||
|
|
||||||
if (envData.n) {
|
|
||||||
await jail.set('__n_input', envData.n);
|
|
||||||
properties.push('n: exportedVars.nFunction(__n_input)');
|
|
||||||
}
|
|
||||||
if (envData.sig) {
|
|
||||||
await jail.set('__sig_input', envData.sig);
|
|
||||||
properties.push('sig: exportedVars.sigFunction(__sig_input)');
|
|
||||||
}
|
|
||||||
|
|
||||||
const code = `${data.output}\n({ ${properties.join(', ')} })`;
|
|
||||||
const script = await isolate.compileScript(code);
|
const script = await isolate.compileScript(code);
|
||||||
return await script.run(context, { copy: true, timeout: 5000 });
|
return await script.run(context, { copy: true, timeout: 5000 });
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
10
pnpm-lock.yaml
generated
10
pnpm-lock.yaml
generated
@ -62,8 +62,8 @@ importers:
|
|||||||
specifier: 1.0.3
|
specifier: 1.0.3
|
||||||
version: 1.0.3
|
version: 1.0.3
|
||||||
youtubei.js:
|
youtubei.js:
|
||||||
specifier: 16.0.1
|
specifier: 17.0.1
|
||||||
version: 16.0.1
|
version: 17.0.1
|
||||||
zod:
|
zod:
|
||||||
specifier: ^4.2.1
|
specifier: ^4.2.1
|
||||||
version: 4.2.1
|
version: 4.2.1
|
||||||
@ -2114,8 +2114,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
|
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
youtubei.js@16.0.1:
|
youtubei.js@17.0.1:
|
||||||
resolution: {integrity: sha512-3802bCAGkBc2/G5WUTc0l/bO5mPYJbQAHL04d9hE9PnrDHoBUT8MN721Yqt4RCNncAXdHcfee9VdJy3Fhq1r5g==}
|
resolution: {integrity: sha512-1lO4b8UqMDzE0oh2qEGzbBOd4UYRdxn/4PdpRM7BGTHxM6ddsEsKZTu90jp8V9FHVgC2h1UirQyqoqLiKwl+Zg==}
|
||||||
|
|
||||||
zimmerframe@1.1.2:
|
zimmerframe@1.1.2:
|
||||||
resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==}
|
resolution: {integrity: sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==}
|
||||||
@ -3945,7 +3945,7 @@ snapshots:
|
|||||||
|
|
||||||
yocto-queue@0.1.0: {}
|
yocto-queue@0.1.0: {}
|
||||||
|
|
||||||
youtubei.js@16.0.1:
|
youtubei.js@17.0.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@bufbuild/protobuf': 2.2.5
|
'@bufbuild/protobuf': 2.2.5
|
||||||
meriyah: 6.1.4
|
meriyah: 6.1.4
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user