only use normal fetcher if its cors-allowed

This commit is contained in:
Jorrin
2024-03-31 19:11:09 +02:00
parent 55f963611c
commit 9258c97de8

View File

@@ -22,7 +22,7 @@ export async function validatePlayableStream(
stream: Stream,
ops: ProviderRunnerOptions | IndividualEmbedRunnerOptions,
): Promise<Stream | null> {
const fetcher = stream.flags.includes('cors-allowed') ? ops.fetcher : ops.proxiedFetcher;
const fetcher = stream.flags.length === 1 && stream.flags.includes('cors-allowed') ? ops.fetcher : ops.proxiedFetcher;
if (stream.type === 'hls') {
const headResult = await fetcher.full(stream.playlist, {
method: 'HEAD',