Fix series scraping

Series scraping was off for some series, this fixes it + also adds support for episodes that are in multiple parts (continuation of each other) as the provider returns them as a single file in episode ranges.
This commit is contained in:
teddyHV11
2024-04-07 15:33:04 +03:00
parent 73facc0184
commit 7dc5a5ac83

View File

@@ -23,21 +23,23 @@ export const insertunitScraper = makeSourcerer({
ctx.progress(60); ctx.progress(60);
const seasonTable = JSON.parse(seasonData[1]); const seasonTable = JSON.parse(seasonData[1]);
for (const season of seasonTable) { for (const seasonElement of seasonTable) {
if (season.season === ctx.media.season.number) { if (seasonElement.season === ctx.media.season.number) {
if (season.episodes[ctx.media.episode.number] && season.episodes[ctx.media.episode.number].hls) { for (const episodeElement of seasonElement.episodes) {
return { if (episodeElement.episode.includes(ctx.media.episode.number)) {
embeds: [], return {
stream: [ embeds: [],
{ stream: [
id: 'primary', {
captions: [], id: 'primary',
playlist: season.episodes[ctx.media.episode.number].hls, captions: [],
type: 'hls', playlist: episodeElement.hls,
flags: [flags.CORS_ALLOWED], type: 'hls',
}, flags: [flags.CORS_ALLOWED],
], },
}; ],
};
}
} }
} }
} }