Fixed include object. Fixed qu's undefined URL handling.

This commit is contained in:
DebaucheryLibrarian 2020-09-08 03:26:34 +02:00
parent 7c6243cf33
commit 03ba35d65a
8 changed files with 24 additions and 14 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -1259,6 +1259,10 @@ const aliases = [
name: 'cunnilingus',
for: 'pussy-eating',
},
{
name: 'cunilingus',
for: 'pussy-eating',
},
{
name: 'pussy licking',
for: 'pussy-eating',

View File

@ -617,7 +617,7 @@ const tagPosters = [
['dvp', 'poster', 'Riley Reid in "Pizza That Ass" for Reid My Lips'],
['dv-tp', 'poster', 'Juelz Ventura in "Gangbanged 5" for Elegant Angel'],
['ebony', 2, 'Nia Nacci for Sweetheart Video'],
['facefucking', 1, 'Paige Owens in "Dark Meat 12" for Evil Angel'],
['facefucking', 4, 'Brooklyn Gray in "Throats Fucks 6" for Evil Angel'],
['facial', 0, 'Brooklyn Gray in "All About Ass 4" for Evil Angel'],
['fake-boobs', 2, 'Gia Milana in "Hot Anal Latina" for HardX'],
['family', 0, 'Teanna Trump in "A Family Appear: Part One" for Brazzers'],
@ -707,6 +707,7 @@ const tagPhotos = [
['ebony', 1, 'Ana Foxxx in "DP Me 4" for HardX'],
['facial', 2, 'Ashly Anderson for Hookup Hotshot'],
['facial', 'poster', 'Jynx Maze'],
['facefucking', 1, 'Paige Owens in "Dark Meat 12" for Evil Angel'],
['facefucking', 2, 'Jynx Maze for Throated'],
['facefucking', 3, 'Adriana Chechik in "Performing Magic Butt Tricks With Jules Jordan. What Will Disappear In Her Ass?" for Jules Jordan'],
['fake-boobs', 9, 'Putri Cinta for StasyQ'],

View File

@ -310,7 +310,7 @@ async function fetchActorReleases(profileUrl, getActorReleasesUrl, page = 1, acc
if (!res.ok) return [];
const releases = scrapeAll(res.item.html, null, origin);
const nextPage = res.item.qu.url('.Gamma_Paginator a.next');
const nextPage = res.item.query.url('.Gamma_Paginator a.next');
if (nextPage) {
return fetchActorReleases(profileUrl, getActorReleasesUrl, page + 1, accReleases.concat(releases));
@ -434,8 +434,6 @@ async function fetchApiLatest(site, page = 1, preData, include, upcoming = false
encodeJSON: true,
});
console.log(page, res.statusCode, res.body.results);
if (res.statusCode === 200 && res.body.results?.[0]?.hits) {
return scrapeApiReleases(res.body.results[0].hits, site);
}
@ -592,7 +590,7 @@ async function fetchProfile({ name: actorName }, context, altSearchUrl, getActor
return null;
}
async function fetchApiProfile(actorName, context, include) {
async function fetchApiProfile({ name: actorName }, context, include) {
const siteSlug = context.entity.slug || context.site?.slug || context.network?.slug;
const actorSlug = encodeURI(actorName);
@ -600,7 +598,7 @@ async function fetchApiProfile(actorName, context, include) {
const { apiUrl } = await fetchApiCredentials(referer);
const res = await bhttp.post(apiUrl, {
const res = await http.post(apiUrl, {
requests: [
{
indexName: 'all_actors',
@ -608,13 +606,12 @@ async function fetchApiProfile(actorName, context, include) {
},
],
}, {
headers: {
Referer: referer,
},
}, {
encodeJSON: true,
});
if (res.statusCode === 200 && res.body.results[0].hits.length > 0) {
if (res.status === 200 && res.body.results[0].hits.length > 0) {
const actorData = res.body.results[0].hits.find(actor => slugify(actor.name) === slugify(actorName));
if (actorData) {

View File

@ -7,8 +7,8 @@ function include(argv) {
photos: argv.media && argv.photos,
poster: argv.media && argv.posters,
posters: argv.media && argv.posters,
releases: argv.withScenes,
scenes: argv.withScenes,
releases: argv.actorsScenes,
scenes: argv.actorsScenes,
teaser: argv.media && argv.videos && argv.teasers,
teasers: argv.media && argv.videos && argv.teasers,
trailer: argv.media && argv.videos && argv.trailers,

View File

@ -40,6 +40,10 @@ function formatDate(dateValue, format, inputFormat) {
}
function prefixUrl(urlValue, origin, protocol = 'https') {
if (!urlValue) {
return null;
}
if (/^http/.test(urlValue)) {
return urlValue;
}
@ -52,9 +56,13 @@ function prefixUrl(urlValue, origin, protocol = 'https') {
return `${origin}${urlValue}`;
}
if (origin) {
return `${origin}/${urlValue}`;
}
return urlValue;
}
function q(context, selector, attrArg, applyTrim = true) {
const attr = attrArg === true ? 'textContent' : attrArg;
@ -217,7 +225,7 @@ function images(context, selector = 'img', attr, { origin, protocol = 'https' }
function url(context, selector = 'a', attr = 'href', { origin, protocol = 'https' } = {}) {
const urlEl = q(context, selector, attr);
return attr ? prefixUrl(urlEl, origin, protocol) : urlEl;
return prefixUrl(urlEl, origin, protocol);
}
function urls(context, selector = 'a', attr = 'href', { origin, protocol = 'https' } = {}) {