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', name: 'cunnilingus',
for: 'pussy-eating', for: 'pussy-eating',
}, },
{
name: 'cunilingus',
for: 'pussy-eating',
},
{ {
name: 'pussy licking', name: 'pussy licking',
for: 'pussy-eating', for: 'pussy-eating',

View File

@ -617,7 +617,7 @@ const tagPosters = [
['dvp', 'poster', 'Riley Reid in "Pizza That Ass" for Reid My Lips'], ['dvp', 'poster', 'Riley Reid in "Pizza That Ass" for Reid My Lips'],
['dv-tp', 'poster', 'Juelz Ventura in "Gangbanged 5" for Elegant Angel'], ['dv-tp', 'poster', 'Juelz Ventura in "Gangbanged 5" for Elegant Angel'],
['ebony', 2, 'Nia Nacci for Sweetheart Video'], ['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'], ['facial', 0, 'Brooklyn Gray in "All About Ass 4" for Evil Angel'],
['fake-boobs', 2, 'Gia Milana in "Hot Anal Latina" for HardX'], ['fake-boobs', 2, 'Gia Milana in "Hot Anal Latina" for HardX'],
['family', 0, 'Teanna Trump in "A Family Appear: Part One" for Brazzers'], ['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'], ['ebony', 1, 'Ana Foxxx in "DP Me 4" for HardX'],
['facial', 2, 'Ashly Anderson for Hookup Hotshot'], ['facial', 2, 'Ashly Anderson for Hookup Hotshot'],
['facial', 'poster', 'Jynx Maze'], ['facial', 'poster', 'Jynx Maze'],
['facefucking', 1, 'Paige Owens in "Dark Meat 12" for Evil Angel'],
['facefucking', 2, 'Jynx Maze for Throated'], ['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'], ['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'], ['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 []; if (!res.ok) return [];
const releases = scrapeAll(res.item.html, null, origin); 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) { if (nextPage) {
return fetchActorReleases(profileUrl, getActorReleasesUrl, page + 1, accReleases.concat(releases)); 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, encodeJSON: true,
}); });
console.log(page, res.statusCode, res.body.results);
if (res.statusCode === 200 && res.body.results?.[0]?.hits) { if (res.statusCode === 200 && res.body.results?.[0]?.hits) {
return scrapeApiReleases(res.body.results[0].hits, site); return scrapeApiReleases(res.body.results[0].hits, site);
} }
@ -592,7 +590,7 @@ async function fetchProfile({ name: actorName }, context, altSearchUrl, getActor
return null; 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 siteSlug = context.entity.slug || context.site?.slug || context.network?.slug;
const actorSlug = encodeURI(actorName); const actorSlug = encodeURI(actorName);
@ -600,7 +598,7 @@ async function fetchApiProfile(actorName, context, include) {
const { apiUrl } = await fetchApiCredentials(referer); const { apiUrl } = await fetchApiCredentials(referer);
const res = await bhttp.post(apiUrl, { const res = await http.post(apiUrl, {
requests: [ requests: [
{ {
indexName: 'all_actors', indexName: 'all_actors',
@ -608,13 +606,12 @@ async function fetchApiProfile(actorName, context, include) {
}, },
], ],
}, { }, {
headers: { Referer: referer,
Referer: referer, }, {
},
encodeJSON: true, 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)); const actorData = res.body.results[0].hits.find(actor => slugify(actor.name) === slugify(actorName));
if (actorData) { if (actorData) {

View File

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

View File

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