Update valid.ts

This commit is contained in:
Pas 2026-01-27 22:38:24 -07:00
parent 47ec40bfb9
commit 0a6ebbd7ee

View file

@ -102,6 +102,7 @@ export async function validatePlayableStream(
return null;
}
} else {
try {
result = await ops.proxiedFetcher.full(stream.playlist, {
method: 'GET',
headers: {
@ -109,6 +110,9 @@ export async function validatePlayableStream(
...stream.headers,
},
});
} catch {
return null;
}
}
if (result.statusCode < 200 || result.statusCode >= 400 || isErrorResponse(result)) return null;
@ -140,7 +144,8 @@ export async function validatePlayableStream(
}
}
return ops.proxiedFetcher.full(quality.url, {
try {
return await ops.proxiedFetcher.full(quality.url, {
method: 'GET',
headers: {
...stream.preferredHeaders,
@ -148,6 +153,9 @@ export async function validatePlayableStream(
Range: 'bytes=0-1',
},
});
} catch {
return { statusCode: 500, body: '', finalUrl: quality.url };
}
}),
);
// remove invalid qualities from the stream