mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 12:43:25 +00:00
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:
@@ -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],
|
||||||
],
|
},
|
||||||
};
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user