forked from DebaucheryLibrarian/traxxx
Expanded Naughty America scraper to support Tonight's Girlfriend (and possibly other native sites).
This commit is contained in:
parent
c581bea185
commit
1e03aa37b7
|
@ -7237,8 +7237,12 @@ const sites = [
|
||||||
slug: 'tonightsgirlfriend',
|
slug: 'tonightsgirlfriend',
|
||||||
alias: ['togc', 'tog'],
|
alias: ['togc', 'tog'],
|
||||||
name: "Tonight's Girlfriend",
|
name: "Tonight's Girlfriend",
|
||||||
url: 'https://www.naughtyamerica.com/site/tonight-s-girlfriend',
|
url: 'https://www.tonightsgirlfriend.com',
|
||||||
parent: 'naughtyamerica',
|
parent: 'naughtyamerica',
|
||||||
|
parameters: {
|
||||||
|
scenes: '/scenes',
|
||||||
|
useActorUrl: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
slug: 'wivesonvacation',
|
slug: 'wivesonvacation',
|
||||||
|
|
|
@ -4,7 +4,8 @@ const unprint = require('unprint');
|
||||||
|
|
||||||
const slugify = require('../utils/slugify');
|
const slugify = require('../utils/slugify');
|
||||||
|
|
||||||
function scrapeLatest(scenes) {
|
// Naughty America network
|
||||||
|
function scrapeLatest(scenes, channel) {
|
||||||
return scenes.map(({ query }) => {
|
return scenes.map(({ query }) => {
|
||||||
const release = {};
|
const release = {};
|
||||||
const url = query.url('a');
|
const url = query.url('a');
|
||||||
|
@ -12,23 +13,26 @@ function scrapeLatest(scenes) {
|
||||||
release.url = url;
|
release.url = url;
|
||||||
release.entryId = query.attribute('a', 'data-scene-id') || (url && new URL(url).pathname.match(/-(\d+)$/)?.[1]) || null;
|
release.entryId = query.attribute('a', 'data-scene-id') || (url && new URL(url).pathname.match(/-(\d+)$/)?.[1]) || null;
|
||||||
|
|
||||||
release.date = query.date('.entry-date', 'MMM D, YYYY');
|
release.date = query.date('.entry-date, .scene-date', 'MMM D, YYYY');
|
||||||
release.duration = query.duration('.scene-runtime');
|
release.duration = query.duration('.scene-runtime');
|
||||||
|
|
||||||
release.actors = query.all('.contain-actors a').map((actorEl) => ({
|
release.actors = query.all('.contain-actors a, .scene-actors a').map((actorEl) => ({
|
||||||
name: unprint.query.content(actorEl),
|
name: unprint.query.content(actorEl),
|
||||||
url: unprint.query.url(actorEl, null),
|
url: channel.parameters?.useActorUrl === false
|
||||||
|
? null // actor URL is scene link in native layout
|
||||||
|
: unprint.query.url(actorEl, null),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
release.poster = [
|
release.poster = [
|
||||||
...(query.sourceSet('source[data-srcset*="scenes/"][type="image/jpeg"]', 'data-srcset') || []),
|
...(query.sourceSet('source[data-srcset*="scenes/"][type="image/jpeg"]', 'data-srcset') || []),
|
||||||
query.img('.main-scene-img', { attribute: 'data-srcset' }),
|
query.img('.main-scene-img', { attribute: 'data-srcset' }),
|
||||||
|
query.img('.scene-thumb'),
|
||||||
];
|
];
|
||||||
|
|
||||||
release.tags = query.contents('.flag-bg');
|
release.tags = query.contents('.flag-bg');
|
||||||
|
|
||||||
release.qualities = [
|
release.qualities = [
|
||||||
query.exists('//a[contains(@class, "label-four-k") and contains(text(), "4K")]') && 2160, // label-four-k is also used for non-4K tags
|
query.exists('//a[contains(@class, "label-four-k") and contains(text(), "4K")] | //span[contains(@class, "bug-4k")]') && 2160, // label-four-k is also used for non-4K tags
|
||||||
query.exists('//a[contains(@class, "label-hd") and contains(text(), "HD")]') && 720,
|
query.exists('//a[contains(@class, "label-hd") and contains(text(), "HD")]') && 720,
|
||||||
].filter(Boolean);
|
].filter(Boolean);
|
||||||
|
|
||||||
|
@ -42,20 +46,24 @@ function scrapeScene({ query }, { url }) {
|
||||||
const release = {};
|
const release = {};
|
||||||
release.entryId = new URL(url).pathname.match(/-(\d+)$/)?.[1];
|
release.entryId = new URL(url).pathname.match(/-(\d+)$/)?.[1];
|
||||||
|
|
||||||
release.title = query.content('.scene-title');
|
release.title = query.content('.scene-title, .grey-title');
|
||||||
release.description = query.text('.synopsis');
|
release.description = query.text('.synopsis, .scene-description');
|
||||||
|
|
||||||
release.date = query.date('.entry-date', 'MMM D, YYYY');
|
release.date = query.date('.entry-date, .released-date', ['MMM D, YYYY', 'MM/DD/YY']);
|
||||||
release.duration = query.duration('.duration');
|
release.duration = query.duration('.duration');
|
||||||
|
|
||||||
release.actors = query.all('.performer-list a').map((actorEl) => ({
|
release.actors = query.exists('.performer-list')
|
||||||
|
? query.all('.performer-list a, .grey-performers a').map((actorEl) => ({
|
||||||
name: unprint.query.content(actorEl),
|
name: unprint.query.content(actorEl),
|
||||||
url: unprint.query.url(actorEl, null),
|
url: unprint.query.url(actorEl, null),
|
||||||
}));
|
}))
|
||||||
|
: query.content('.grey-performers')?.split(',').map((actorName) => actorName.trim());
|
||||||
|
|
||||||
release.poster = [
|
release.poster = [
|
||||||
...(query.sourceSet('source[data-srcset*="scenes/"][type="image/jpeg"]', 'data-srcset') || []),
|
...(query.sourceSet('.play-trailer source[data-srcset*="scenes/"][type="image/jpeg"]', 'data-srcset') || []),
|
||||||
|
...(query.sourceSet('.scenepage-video source[srcset*="scenes/"][type="image/jpeg"]', 'srcset') || []),
|
||||||
query.img('.play-trailer img[data-srcset*="scenes/"]', { attribute: 'data-srcset' }),
|
query.img('.play-trailer img[data-srcset*="scenes/"]', { attribute: 'data-srcset' }),
|
||||||
|
query.img('.scenepage-video .playcard'),
|
||||||
];
|
];
|
||||||
|
|
||||||
release.photos = query.els('.contain-scene-images.desktop-only .scene-image').map((imgEl) => [
|
release.photos = query.els('.contain-scene-images.desktop-only .scene-image').map((imgEl) => [
|
||||||
|
@ -77,7 +85,7 @@ function scrapeScene({ query }, { url }) {
|
||||||
|
|
||||||
release.channel = slugify(query.content('.site-title'), '');
|
release.channel = slugify(query.content('.site-title'), '');
|
||||||
|
|
||||||
release.tags = query.contents('.categories a');
|
release.tags = query.contents('.categories a, .category a');
|
||||||
|
|
||||||
release.qualities = [
|
release.qualities = [
|
||||||
query.exists('//a[contains(@class, "label-four-k") and contains(text(), "4K")]') && 2160, // label-four-k is also used for non-4K tags
|
query.exists('//a[contains(@class, "label-four-k") and contains(text(), "4K")]') && 2160, // label-four-k is also used for non-4K tags
|
||||||
|
@ -92,19 +100,23 @@ async function scrapeProfile({ query }) {
|
||||||
const profile = {};
|
const profile = {};
|
||||||
|
|
||||||
profile.description = query.content('.bio_about_text');
|
profile.description = query.content('.bio_about_text');
|
||||||
profile.avatar = query.img('img.performer-pic');
|
profile.avatar = query.img('img.performer-pic, img.performer-img, img.peformer-img'); // sic peformer
|
||||||
|
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchLatest(site, page = 1) {
|
async function fetchLatest(site, page = 1) {
|
||||||
const res = await unprint.get(`${site.url}?page=${page}`, { selectAll: '.site-list .scene-item' });
|
const res = await unprint.get(`${site.url}${site.parameters?.scenes || ''}?page=${page}`, { selectAll: '.site-list .scene-item, .panel-body' });
|
||||||
|
|
||||||
|
if (res.ok) {
|
||||||
return scrapeLatest(res.context, site);
|
return scrapeLatest(res.context, site);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchProfile({ slug }) {
|
return res.status;
|
||||||
const res = await unprint.get(`https://www.naughtyamerica.com/pornstar/${slug}`, { select: '.bio-info' });
|
}
|
||||||
|
|
||||||
|
async function fetchProfile({ slug }, { channel }) {
|
||||||
|
const res = await unprint.get(`${channel.url}/pornstar/${slug}`, { select: '.bio-info, .performer-details' });
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
return scrapeProfile(res.context);
|
return scrapeProfile(res.context);
|
||||||
|
|
|
@ -266,6 +266,7 @@ const scrapers = {
|
||||||
mylf: teamskeet,
|
mylf: teamskeet,
|
||||||
mugfucked: fullpornnetwork,
|
mugfucked: fullpornnetwork,
|
||||||
naughtyamerica,
|
naughtyamerica,
|
||||||
|
tonightsgirlfriend: naughtyamerica,
|
||||||
nebraskacoeds: elevatedx,
|
nebraskacoeds: elevatedx,
|
||||||
nfbusty: nubiles,
|
nfbusty: nubiles,
|
||||||
nubilefilms: nubiles,
|
nubilefilms: nubiles,
|
||||||
|
|
Loading…
Reference in New Issue