[chore] update dependencies (#832)

* update dependencies

* Update deps and fix
This commit is contained in:
Brahim Hadriche authored and GitHub committed 2026-03-18 09:15:04 -04:00
1 parent 7227d4e26b
commit 0123f9fa8e
7 files changed
+1696 -1807

No files matched your search

+6 -14
View File
@@ -141,20 +141,8 @@ export class YoutubeJs {
static initJsEvaluator() {
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)();
}
return new Function(data.output)();
};
}
static async generateVisitorData() {
@@ -255,6 +243,10 @@ export class YoutubeJs {
po_token: await YoutubeJs.generatePoToken(videoId),
});
if (info.playability_status.status !== 'OK') {
throw new Error(`Video is not playable: ${info.playability_status.status}\nReason: ${info.playability_status.reason}`);
}
// We can't generate a proper dash from live videos.
// By returning null, we're telling Playlet to fetch video info itself.
if (info.basic_info.is_live) {
@@ -49,28 +49,43 @@
});
async function playOnTv() {
const videoInfo = getVideoInfo();
await PlayletApi.playVideo(videoInfo);
try {
const videoInfo = getVideoInfo();
await PlayletApi.playVideo(videoInfo);
} catch (error) {
console.error(error);
alert(error);
}
}
async function playOnTvYtjs() {
const videoInfo = getVideoInfo() as any;
try {
const videoInfo = getVideoInfo() as any;
// measure length of time it takes to get video info
const start = performance.now();
const metadata = await YoutubeJs.getVideoInfo(videoId);
const end = performance.now();
console.log(`Time to get video info: ${end - start}ms`);
// measure length of time it takes to get video info
const start = performance.now();
const metadata = await YoutubeJs.getVideoInfo(videoId);
const end = performance.now();
console.log(`Time to get video info: ${end - start}ms`);
if (metadata) {
videoInfo.metadata = metadata;
if (metadata) {
videoInfo.metadata = metadata;
}
await PlayletApi.playVideo(videoInfo);
} catch (error) {
console.error(error);
alert(error);
}
await PlayletApi.playVideo(videoInfo);
}
async function queueOnTv() {
const videoInfo = getVideoInfo();
await PlayletApi.queueVideo(videoInfo);
try {
const videoInfo = getVideoInfo();
await PlayletApi.queueVideo(videoInfo);
} catch (error) {
console.error(error);
alert(error);
}
}
function openInvidious() {