mirror of
https://github.com/p-stream/providers.git
synced 2026-04-20 11:42:04 +00:00
fix scraper crashing if an embed is not playable
This commit is contained in:
parent
423b728595
commit
db4a7e82dd
1 changed files with 4 additions and 3 deletions
|
|
@ -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],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue