Fixed and refactored Dorcel scraper.

This commit is contained in:
DebaucheryLibrarian
2025-03-05 02:48:43 +01:00
parent bce340e3c2
commit 42b5c0c150
5 changed files with 191 additions and 140 deletions

View File

@@ -198,14 +198,19 @@ async function scrapeUpcomingReleases(scraper, entity, preData) {
return emptyReleases;
}
async function scrapeMovies(scraper, entity) {
async function scrapeMovies(scraper, entity, preData) {
if (!argv.movies || !scraper.fetchMovies) {
return [];
}
try {
const context = {
...preData,
include,
parameters: getRecursiveParameters(entity),
};
// return await scrapeReleases(scraper, entity, preData, true);
return await scraper.fetchMovies(entity);
return await scraper.fetchMovies(entity, 1, context); // TODO: implement pagination
} catch (error) {
logger.warn(`Failed to scrape movies for '${entity.slug}' (${entity.parent?.slug}): ${error.message}`);
}