Fixed expect type associated to wrong object in Bang scraper.

This commit is contained in:
DebaucheryLibrarian
2026-03-27 03:22:51 +01:00
parent 69d410666d
commit f5da798cd2
2 changed files with 10 additions and 2 deletions

View File

@@ -558,6 +558,10 @@ async function storeImageFile(media, hashDir, hashSubDir, filename, filedir, fil
}, },
}; };
} catch (error) { } catch (error) {
if (argv.debug) {
console.trace(error);
}
logger.error(`Failed to store ${media.id} from ${media.src} at ${filepath}: ${error.message}`); logger.error(`Failed to store ${media.id} from ${media.src} at ${filepath}: ${error.message}`);
await fsPromises.unlink(media.file.path); await fsPromises.unlink(media.file.path);
@@ -1000,6 +1004,10 @@ async function associateReleaseMedia(releases, type = 'release') {
logger.error(util.inspect(error.entries.slice(0, 2), null, null, { color: true }), `${Math.min(error.entries.length, 2)} of ${error.length}`); logger.error(util.inspect(error.entries.slice(0, 2), null, null, { color: true }), `${Math.min(error.entries.length, 2)} of ${error.length}`);
} }
if (argv.debug) {
console.trace(error);
}
logger.error(`Failed to store ${type} ${role}: ${error.message} (${error.detail || 'no detail'})`); logger.error(`Failed to store ${type} ${role}: ${error.message} (${error.detail || 'no detail'})`);
} }
}, Promise.resolve()); }, Promise.resolve());

View File

@@ -173,12 +173,12 @@ async function scrapeScene({ query }, { url, entity }) {
|| query.attribute('meta[property="og:video"]') || query.attribute('meta[property="og:video"]')
|| query.video('video[data-videocontainer-target] source'); || query.video('video[data-videocontainer-target] source');
release.photos = query.sourceSets('div[data-controller] a[href^="/photos"] img').map((src) => ({ release.photos = query.sourceSets('div[data-controller] a[href^="/photos"] img').map((sourceSet) => sourceSet.map((src) => ({
src, src,
expectType: { expectType: {
'application/octet-stream': 'image/jpeg', 'application/octet-stream': 'image/jpeg',
}, },
})); })));
release.photoCount = query.number('//h2[contains(text(), "Photos")]/following-sibling::span'); release.photoCount = query.number('//h2[contains(text(), "Photos")]/following-sibling::span');