Files
invidious/patches/companion/0009-fix-check-for-formats.url-since-most-videos-will-hav.patch
T
2025-06-27 13:54:34 +02:00

21 lines
983 B
Diff

diff --git a/src/lib/jobs/potoken.ts b/src/lib/jobs/potoken.ts
index f6b9aee..aca59a4 100644
--- a/src/lib/jobs/potoken.ts
+++ b/src/lib/jobs/potoken.ts
@@ -172,13 +172,13 @@ async function checkToken({
instantiatedInnertubeClient,
youtubePlayerResponseJson,
);
- const validFormat = videoInfo.streaming_data?.adaptive_formats[0];
+ const validFormat = videoInfo.streaming_data?.adaptive_formats[0].url || videoInfo.streaming_data?.formats[0].url;
if (!validFormat) {
throw new Error(
"failed to find valid video with adaptive format to check token against",
);
}
- const result = await fetchImpl(validFormat?.url, { method: "HEAD" });
+ const result = await fetchImpl(validFormat, { method: "HEAD" });
if (result.status !== 200) {
throw new Error(
`did not get a 200 when checking video, got ${result.status} instead`,