Major API change for 'q', renamed to 'qu', refactored modules. Fixed Gamma URL entry ID regex.
This commit is contained in:
@@ -198,7 +198,7 @@ async function scrapeScene(html, url, site, baseRelease, mobileHtml) {
|
||||
const [data, data2] = json ? JSON.parse(json) : [];
|
||||
const videoData = videoJson && JSON.parse(videoJson.slice(videoJson.indexOf('{'), videoJson.indexOf('};') + 1));
|
||||
|
||||
release.entryId = (baseRelease?.path || new URL(url).pathname).match(/\/(\d{2,})\//)[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
|
||||
@@ -298,10 +298,12 @@ async function fetchActorReleases(profileUrl, getActorReleasesUrl, page = 1, acc
|
||||
const profilePath = `/${pathname.split('/').slice(-2).join('/')}`;
|
||||
|
||||
const url = getActorReleasesUrl(profilePath, page);
|
||||
const { html, qu } = await get(url);
|
||||
const res = await get(url);
|
||||
|
||||
const releases = scrapeAll(html, null, origin);
|
||||
const nextPage = qu('.Gamma_Paginator a.next');
|
||||
if (!res.ok) return [];
|
||||
|
||||
const releases = scrapeAll(res.html, null, origin);
|
||||
const nextPage = res.item.qu.url('.Gamma_Paginator a.next');
|
||||
|
||||
if (nextPage) {
|
||||
return fetchActorReleases(profileUrl, getActorReleasesUrl, page + 1, accReleases.concat(releases));
|
||||
|
||||
Reference in New Issue
Block a user