mirror of
https://github.com/sussy-code/providers.git
synced 2026-08-14 11:22:18 +00:00
better error handeling
This commit is contained in:
parent
9ec5f57e90
commit
ce7b80ff4e
1 changed files with 9 additions and 0 deletions
|
|
@ -16,8 +16,17 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis
|
|||
if (!apiRes) {
|
||||
throw new NotFoundError('Failed to fetch StreamBox data');
|
||||
}
|
||||
|
||||
const data = await apiRes;
|
||||
|
||||
if (data.provider !== 'MovieBox') {
|
||||
throw new NotFoundError('Not a MovieBox provider response');
|
||||
}
|
||||
|
||||
if (!data.url || data.url.length === 0) {
|
||||
throw new NotFoundError('No MovieBox streams found');
|
||||
}
|
||||
|
||||
const streams: Record<string, string> = {};
|
||||
data.url.forEach((stream: any) => {
|
||||
streams[stream.resulation] = stream.link;
|
||||
|
|
|
|||
Loading…
Reference in a new issue