forked from DebaucheryLibrarian/traxxx
Added Vivid network. Added ASMR Fantasy to Adult Time. Storing deep URL in database. Added href to header links.
This commit is contained in:
@@ -184,7 +184,7 @@ async function scrapeScene(html, url, site, scrapedRelease) {
|
||||
const videoJson = $('script:contains("window.ScenePlayerOptions")').html();
|
||||
|
||||
const [data, data2] = json ? JSON.parse(json) : [];
|
||||
const videoData = JSON.parse(videoJson.slice(videoJson.indexOf('{'), videoJson.indexOf('};') + 1));
|
||||
const videoData = videoJson && JSON.parse(videoJson.slice(videoJson.indexOf('{'), videoJson.indexOf('};') + 1));
|
||||
|
||||
[release.entryId] = (scrapedRelease?.path || new URL(url).pathname).split('/').slice(-1);
|
||||
release.title = videoData?.playerOptions?.sceneInfos.sceneTitle || data?.name;
|
||||
@@ -217,14 +217,14 @@ async function scrapeScene(html, url, site, scrapedRelease) {
|
||||
}));
|
||||
}
|
||||
|
||||
const hasTrans = release.actors.some(actor => actor.gender === 'shemale');
|
||||
const hasTrans = release.actors?.some(actor => actor.gender === 'shemale');
|
||||
const rawTags = data?.keywords?.split(', ') || data2?.keywords?.split(', ');
|
||||
release.tags = hasTrans ? [...rawTags, 'transsexual'] : rawTags;
|
||||
|
||||
const channel = data?.productionCompany?.name || $('.studioLink a, .siteLink a').attr('title')?.trim();
|
||||
if (channel) release.channel = slugify(channel, { delimiter: '' });
|
||||
|
||||
release.poster = videoData.picPreview;
|
||||
if (videoData.picPreview && new URL(videoData.picPreview).pathname.length > 1) release.poster = videoData.picPreview; // sometimes links to just https://images02-fame.gammacdn.com/
|
||||
|
||||
const photoLink = $('.picturesItem a').attr('href');
|
||||
if (photoLink) release.photos = await getPhotos(photoLink, site);
|
||||
@@ -472,7 +472,9 @@ async function fetchScene(url, site, release) {
|
||||
const res = await bhttp.get(deepUrl);
|
||||
|
||||
if (res.statusCode === 200) {
|
||||
return scrapeScene(res.body.toString(), url, site, release);
|
||||
const scene = await scrapeScene(res.body.toString(), url, site, release);
|
||||
|
||||
return { ...scene, deepUrl };
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user