From a4519724e8a9e9e843f386fd9ddf9dc7c587440d Mon Sep 17 00:00:00 2001 From: Emilien <4016501+unixfox@users.noreply.github.com> Date: Wed, 11 Dec 2024 21:40:39 +0100 Subject: [PATCH] fix new usage with youtube.js v12 + fix av01 default usage --- src/lib/helpers/youtubePlayerReq.ts | 2 +- src/routes/invidious_routes/dashManifest.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/helpers/youtubePlayerReq.ts b/src/lib/helpers/youtubePlayerReq.ts index 1ffe1c0..0715402 100644 --- a/src/lib/helpers/youtubePlayerReq.ts +++ b/src/lib/helpers/youtubePlayerReq.ts @@ -25,6 +25,6 @@ export const youtubePlayerReq = async (innertubeClient: Innertube, videoId: stri serviceIntegrityDimensions: { poToken: innertubeClient.session.po_token }, - innertubeClientUsed + client: innertubeClientUsed }); }; diff --git a/src/routes/invidious_routes/dashManifest.ts b/src/routes/invidious_routes/dashManifest.ts index ca4c4c7..cb672bd 100644 --- a/src/routes/invidious_routes/dashManifest.ts +++ b/src/routes/invidious_routes/dashManifest.ts @@ -44,7 +44,12 @@ dashManifest.get("/:videoId", async (c) => { .streaming_data.adaptive_formats .filter((i) => { if (i.mime_type.includes("mp4")) { - if (i.has_video) { + if ( + i.has_video && + JSON.stringify( + videoInfo.streaming_data?.adaptive_formats, + ).includes("av01") + ) { if (i.mime_type.includes("av01")) { return true; } else {