mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 15:33:26 +00:00
only use normal fetcher if its cors-allowed
This commit is contained in:
@@ -22,7 +22,7 @@ export async function validatePlayableStream(
|
|||||||
stream: Stream,
|
stream: Stream,
|
||||||
ops: ProviderRunnerOptions | IndividualEmbedRunnerOptions,
|
ops: ProviderRunnerOptions | IndividualEmbedRunnerOptions,
|
||||||
): Promise<Stream | null> {
|
): 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') {
|
if (stream.type === 'hls') {
|
||||||
const headResult = await fetcher.full(stream.playlist, {
|
const headResult = await fetcher.full(stream.playlist, {
|
||||||
method: 'HEAD',
|
method: 'HEAD',
|
||||||
|
Reference in New Issue
Block a user