mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 18:13:25 +00:00
skip validation check for warezcdnmp4
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { warezcdnembedMp4Scraper } from '@/providers/embeds/warezcdn/mp4';
|
||||
import { Stream } from '@/providers/streams';
|
||||
import { IndividualEmbedRunnerOptions } from '@/runners/individualRunner';
|
||||
import { ProviderRunnerOptions } from '@/runners/runner';
|
||||
|
||||
const SKIP_VALIDATION_CHECK_IDS = [warezcdnembedMp4Scraper.id];
|
||||
|
||||
export function isValidStream(stream: Stream | undefined): boolean {
|
||||
if (!stream) return false;
|
||||
if (stream.type === 'hls') {
|
||||
@@ -21,7 +24,10 @@ export function isValidStream(stream: Stream | undefined): boolean {
|
||||
export async function validatePlayableStream(
|
||||
stream: Stream,
|
||||
ops: ProviderRunnerOptions | IndividualEmbedRunnerOptions,
|
||||
sourcererId: string,
|
||||
): Promise<Stream | null> {
|
||||
if (SKIP_VALIDATION_CHECK_IDS.includes(sourcererId)) return stream;
|
||||
|
||||
if (stream.type === 'hls') {
|
||||
const result = await ops.proxiedFetcher.full(stream.playlist, {
|
||||
method: 'GET',
|
||||
@@ -63,8 +69,11 @@ export async function validatePlayableStream(
|
||||
export async function validatePlayableStreams(
|
||||
streams: Stream[],
|
||||
ops: ProviderRunnerOptions | IndividualEmbedRunnerOptions,
|
||||
sourcererId: string,
|
||||
): Promise<Stream[]> {
|
||||
return (await Promise.all(streams.map((stream) => validatePlayableStream(stream, ops)))).filter(
|
||||
if (SKIP_VALIDATION_CHECK_IDS.includes(sourcererId)) return streams;
|
||||
|
||||
return (await Promise.all(streams.map((stream) => validatePlayableStream(stream, ops, sourcererId)))).filter(
|
||||
(v) => v !== null,
|
||||
) as Stream[];
|
||||
}
|
||||
|
Reference in New Issue
Block a user