mirror of
https://git.nerdvpn.de/NerdVPN.de/invidious
synced 2026-02-14 22:51:42 +01:00
21 lines
983 B
Diff
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`,
|