Fixed Adult Time scraper.

This commit is contained in:
DebaucheryLibrarian 2022-02-07 22:16:43 +01:00
parent bd5babd37e
commit 3d349c413f
2 changed files with 5 additions and 5 deletions

View File

@ -130,7 +130,7 @@ async function scrapeRelease(baseRelease, entitiesBySlug, type = 'scene') {
? await fetchScene(layoutScraper, baseRelease.url, entity, baseRelease, options)
: await fetchMovie(layoutScraper, baseRelease.url, entity, baseRelease, options);
const pathname = new URL(baseRelease.url).pathname.replace(/\//g, '_');
const pathname = baseRelease.path || (baseRelease.url && new URL(baseRelease.url).pathname.replace(/\//g, '_'));
if (rawScrapedRelease) {
delete rawScrapedRelease.query; // some scrapers pass the qu-wrapped window instance to parent scrapers, filling up memory

View File

@ -1,20 +1,20 @@
'use strict';
const { fetchApiLatest, fetchApiUpcoming, fetchScene, fetchApiProfile } = require('./gamma');
const { fetchApiLatest, fetchApiUpcoming, fetchSceneApi, fetchApiProfile } = require('./gamma');
function curateRelease(release, site) {
if (['bubblegumdungeon', 'ladygonzo'].includes(site.slug)) {
return {
...release,
title: release.title.split(/:|\|/)[1].trim(),
title: release.title.split(/:|\|/)[1]?.trim(),
};
}
return release;
}
async function networkFetchScene(url, site, release) {
const scene = await fetchScene(url, site, release);
async function networkFetchScene(url, site, release, options) {
const scene = await fetchSceneApi(url, site, release, options);
return curateRelease(scene, site);
}