forked from DebaucheryLibrarian/traxxx
Fixed Gamma scene scraper extracting the wrong scene ID from non-standard URLs.
This commit is contained in:
@@ -187,7 +187,7 @@ function scrapeAll(html, site, networkUrl, hasTeaser = true) {
|
||||
});
|
||||
}
|
||||
|
||||
async function scrapeScene(html, url, site, scrapedRelease, mobileHtml) {
|
||||
async function scrapeScene(html, url, site, baseRelease, mobileHtml) {
|
||||
const $ = cheerio.load(html, { normalizeWhitespace: true });
|
||||
const m$ = mobileHtml && cheerio.load(mobileHtml, { normalizeWhitespace: true });
|
||||
const release = { $, url };
|
||||
@@ -198,7 +198,7 @@ async function scrapeScene(html, url, site, scrapedRelease, mobileHtml) {
|
||||
const [data, data2] = json ? JSON.parse(json) : [];
|
||||
const videoData = videoJson && JSON.parse(videoJson.slice(videoJson.indexOf('{'), videoJson.indexOf('};') + 1));
|
||||
|
||||
[release.entryId] = (scrapedRelease?.path || new URL(url).pathname).split('/').slice(-1);
|
||||
release.entryId = (baseRelease?.path || new URL(url).pathname).match(/\/(\d{2,})\//)[1];
|
||||
release.title = videoData?.playerOptions?.sceneInfos.sceneTitle || data?.name;
|
||||
|
||||
// date in data object is not the release date of the scene, but the date the entry was added; only use as fallback
|
||||
|
||||
Reference in New Issue
Block a user