diff --git a/src/providers/sources/debrid/index.ts b/src/providers/sources/debrid/index.ts index d4f579f..9cb3099 100644 --- a/src/providers/sources/debrid/index.ts +++ b/src/providers/sources/debrid/index.ts @@ -112,15 +112,15 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis torrentioUrl += `movie/${ctx.media.imdbId}.json`; } const torrentioData = (await ctx.proxiedFetcher(torrentioUrl)) as torrentioResponse; - // console.log('torrentioData', torrentioData); const torrentioStreams = torrentioData?.streams || []; - // console.log('torrentioStreams', torrentioStreams); - if (torrentioStreams.length === 0) { - throw new NotFoundError('No streams found'); + console.log('No torrents found', torrentioData); + throw new NotFoundError('No torrents found'); } + ctx.progress(33); + const response: DebridParsedStream[] = await ctx.proxiedFetcher('https://torrent-parse.pstream.mov/', { method: 'POST', headers: { @@ -128,6 +128,12 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis }, body: JSON.stringify(torrentioStreams), }); + if (response.length === 0) { + console.log('No streams found or parse failed!', response); + throw new NotFoundError('No streams found or parse failed!'); + } + + ctx.progress(66); // Group by quality, pick the most compatible stream for each const qualities: Partial> = {}; @@ -170,6 +176,8 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis } } + ctx.progress(100); + return { embeds: [], stream: [