mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 13:43:25 +00:00
fix scraper crashing if an embed is not playable
This commit is contained in:
@@ -151,6 +151,9 @@ export async function runAllProviders(list: ProviderList, ops: ProviderRunnerOpt
|
||||
if (embedOutput.stream.length === 0) {
|
||||
throw new NotFoundError('No streams found');
|
||||
}
|
||||
const playableStream = await validatePlayableStream(embedOutput.stream[0], ops);
|
||||
if (!playableStream) throw new NotFoundError('No streams found');
|
||||
embedOutput.stream = [playableStream];
|
||||
} catch (error) {
|
||||
const updateParams: UpdateEvent = {
|
||||
id: source.id,
|
||||
@@ -163,13 +166,11 @@ export async function runAllProviders(list: ProviderList, ops: ProviderRunnerOpt
|
||||
ops.events?.update?.(updateParams);
|
||||
continue;
|
||||
}
|
||||
const playableStream = await validatePlayableStream(embedOutput.stream[0], ops);
|
||||
if (!playableStream) throw new NotFoundError('No streams found');
|
||||
|
||||
return {
|
||||
sourceId: source.id,
|
||||
embedId: scraper.id,
|
||||
stream: playableStream,
|
||||
stream: embedOutput.stream[0],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user