Added Vivid network. Added ASMR Fantasy to Adult Time. Storing deep URL in database. Added href to header links.

This commit is contained in:
2020-02-11 04:58:18 +01:00
parent 114e2e03b2
commit dd6a1d9bfd
44 changed files with 1322 additions and 35 deletions

View File

@@ -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;