mirror of
https://github.com/p-stream/providers.git
synced 2026-01-11 20:10:33 +00:00
This commit is contained in:
parent
e524125a2b
commit
b03b4e9f68
1 changed files with 12 additions and 4 deletions
|
|
@ -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<Record<'4k' | 1080 | 720 | 480 | 360 | 'unknown', { type: 'mp4'; url: string }>> = {};
|
||||
|
|
@ -170,6 +176,8 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis
|
|||
}
|
||||
}
|
||||
|
||||
ctx.progress(100);
|
||||
|
||||
return {
|
||||
embeds: [],
|
||||
stream: [
|
||||
|
|
|
|||
Loading…
Reference in a new issue