Improved Gamma scraper for (XEmpire) actors.

This commit is contained in:
2020-05-20 03:00:46 +02:00
parent b1b7cd6d50
commit 7275fb10e3
8 changed files with 17 additions and 8 deletions

View File

@@ -26,7 +26,6 @@ async function init() {
if (argv.actorScenes) {
const actorReleases = actors.map(actor => actor.releases).flat().filter(Boolean);
console.log(actors, actorReleases);
await storeReleases(actorReleases);
}

View File

@@ -175,6 +175,9 @@ function scrapeAll(html, site, networkUrl, hasTeaser = true) {
const posterEl = $(element).find('.imgLink img, .tlcImageItem');
if (posterEl) release.poster = posterEl.attr('data-original') || posterEl.attr('src');
const channelEl = $(element).find('.fromSite a');
if (channelEl) release.channel = channelEl.attr('title').replace('.com', '');
if (hasTeaser) {
release.teaser = [
{ src: `https://videothumb.gammacdn.com/600x339/${release.entryId}.mp4` },
@@ -232,7 +235,11 @@ async function scrapeScene(html, url, site, baseRelease, mobileHtml) {
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() || $('.siteNameSpan').text()?.trim().toLowerCase().replace('.com', '');
const channel = data?.productionCompany?.name
|| $('.studioLink a, .siteLink a').attr('title')?.trim()
|| $('.siteNameSpan').text()?.trim().toLowerCase().replace('.com', '')
|| $('meta[name="twitter:domain"]').attr('content')?.replace('.com', '');
if (channel) release.channel = slugify(channel, '');
if (videoData.picPreview && new URL(videoData.picPreview).pathname.length > 1) release.poster = videoData.picPreview; // sometimes links to just https://images02-fame.gammacdn.com/
@@ -301,7 +308,7 @@ async function fetchActorReleases(profileUrl, getActorReleasesUrl, page = 1, acc
if (!res.ok) return [];
const releases = scrapeAll(res.html, null, origin);
const releases = scrapeAll(res.item.html, null, origin);
const nextPage = res.item.qu.url('.Gamma_Paginator a.next');
if (nextPage) {