Added The Flourish, adapted Arch Angel scraper.

This commit is contained in:
DebaucheryLibrarian
2023-11-07 04:29:35 +01:00
parent 7caa325c5f
commit eba96df631
45 changed files with 101 additions and 15 deletions

View File

@@ -1,5 +1,7 @@
'use strict';
// ALSO USED BY THE FLOURISH
const unprint = require('unprint');
const slugify = require('../utils/slugify');
@@ -29,12 +31,27 @@ function scrapeAll(scenes) {
}));
const poster = query.img('img.mainThumb');
const previewCount = query.number('img.mainThumb', { attribute: 'cnt' });
if (poster && !placeholder.test(poster)) {
release.poster = poster;
const posterFallbacks = [
poster.replace('-1x', '-3x'),
poster.replace('-1x', '-2x'),
poster.replace('-1x', '-4x'),
poster,
];
release.poster = posterFallbacks;
}
release.photoCount = query.number('.timeDate');
if (previewCount) {
release.photos = Array.from(
{ length: previewCount - 1 },
(value, index) => [3, 2, 4, 1].map((scale) => unprint.prefixUrl(query.img('img.mainThumb', { attribute: `src${index + 1}_${scale}x` }))).filter(Boolean), // 4x is unnecessarily big and possibly upscaled
).filter(Boolean);
}
release.photoCount = query.number('.timeDate', { match: /(\d+) photos/i, matchIndex: 1 });
release.entryId = getEntryId(release);
@@ -42,7 +59,7 @@ function scrapeAll(scenes) {
});
}
function scrapeScene({ query, html }, { url }) {
function scrapeScene({ query, html }, { url, entity, baseRelease }) {
const release = { url };
release.title = query.content('.title h2');
@@ -56,18 +73,35 @@ function scrapeScene({ query, html }, { url }) {
url: unprint.query.url(actorEl, null),
}));
const poster = query.img('.update_thumb') || html.match(/poster="(.*\.jpg)"/)?.[1];
const poster = unprint.prefixUrl(query.img('.update_thumb') || html.match(/poster="(.*\.jpg)"/)?.[1], entity.url);
if (poster && !placeholder.test(poster)) {
release.poster = poster;
const posterFallbacks = [
poster.replace('-1x', '-3x'),
poster.replace('-1x', '-2x'),
poster.replace('-1x', '-4x'),
poster,
];
// scene page poster usually different from overview page, don't replace
if (baseRelease?.poster && baseRelease.poster !== poster) {
release.photos = baseRelease.photos
? [posterFallbacks, ...baseRelease.photos]
: [posterFallbacks];
} else {
release.poster = posterFallbacks;
}
}
release.trailer = html.match(/src="(.*\.mp4)"/)?.[1];
const trailer = html.match(/src="(.*\.mp4)"/)?.[1];
release.photoCount = query.number('.info', { match: /(\d+) photos/i, matchIndex: 1 });
if (trailer) {
release.trailer = unprint.prefixUrl(encodeURI(trailer), entity.url);
}
release.tags = query.contents('.info .tags a');
release.photoCount = query.number('.info', { match: /(\d+) photos/i, matchIndex: 1 });
release.entryId = getEntryId(release);
return release;
@@ -129,8 +163,8 @@ function scrapeProfile({ query, element }, { url, entity }) {
return profile;
}
async function fetchLatest(channel, page = 1) {
const url = `${channel.url}/tour/categories/movies_${page}_d.html`;
async function fetchLatest(channel, page = 1, context) {
const url = `${channel.url}${context.parameters.path || ''}/categories/movies_${page}_d.html`;
const res = await unprint.get(url, { selectAll: '.item-video' });
if (res.ok) {
@@ -140,11 +174,11 @@ async function fetchLatest(channel, page = 1) {
return res.status;
}
async function fetchProfile({ name: actorName, url: actorUrl }, { entity, include }) {
async function fetchProfile({ name: actorName, url: actorUrl }, { entity, include, parameters }) {
const res = await [
actorUrl,
`${entity.url}/tour/models/${slugify(actorName, '-')}.html`,
`${entity.url}/tour/models/${slugify(actorName, '')}.html`,
`${entity.url}${parameters.path || ''}/models/${slugify(actorName, '-')}.html`,
`${entity.url}${parameters.path || ''}/models/${slugify(actorName, '')}.html`,
].reduce(async (chain, url) => {
const prevRes = await chain;

View File

@@ -153,6 +153,7 @@ const scrapers = {
sexyhub: mindgeek,
spizoo,
swallowsalon: julesjordan,
theflourish: archangel,
teencoreclub,
teenmegaworld,
teamskeet,
@@ -294,6 +295,11 @@ const scrapers = {
silviasaint: famedigital,
spizoo,
swallowed: mikeadriano,
milfcandy: archangel,
theflourishamateurs: archangel,
theflourishpov: archangel,
theflourishfetish: archangel,
theflourishxxx: archangel,
teamskeet,
teencoreclub,
teenmegaworld,

View File

@@ -90,9 +90,6 @@ function scrapeProfile({ query }, url, entity) {
profile.avatar = query.img('.model-profile-image-picture source', { origin: entity.url, attribute: 'srcset' }) || query.img('.model-profile-image-picture img', { origin: entity.url });
profile.scenes = scrapeAll(unprint.initAll(query.all('.video-list .thumb')), entity);
console.log(bio);
console.log(profile);
return profile;
}