Filtering out 'Amateur' model in Model Media API.
This commit is contained in:
@@ -2,9 +2,8 @@
|
||||
|
||||
const unprint = require('unprint');
|
||||
|
||||
const http = require('../utils/http');
|
||||
const slugify = require('../utils/slugify');
|
||||
const { feetInchesToCm, lbsToKg } = require('../utils/convert');
|
||||
const { convert } = require('../utils/convert');
|
||||
|
||||
function scrapeAll(scenes, channel, _options) {
|
||||
return scenes.map(({ query }) => {
|
||||
@@ -122,7 +121,7 @@ async function scrapeProfile({ query }) {
|
||||
const bioText = query.content('#profileModal .well');
|
||||
|
||||
profile.description = query.content('#profileModal .modal-body')
|
||||
.slice(bioText.length)
|
||||
?.slice(bioText?.length || 0)
|
||||
.replace(/Biography Text ©Adult DVD Empire/i, '')
|
||||
.trim();
|
||||
|
||||
@@ -132,8 +131,8 @@ async function scrapeProfile({ query }) {
|
||||
profile.eyes = bio.eyes;
|
||||
profile.ethnicity = bio.ethnicity;
|
||||
|
||||
profile.height = feetInchesToCm(bio.height);
|
||||
profile.weight = lbsToKg(bio.weight);
|
||||
profile.height = convert(bio.height, 'cm');
|
||||
profile.weight = convert(bio.weight, 'lb', 'kg');
|
||||
|
||||
const avatar = query.img('picture img, .performer-image-container img');
|
||||
|
||||
@@ -146,6 +145,8 @@ async function scrapeProfile({ query }) {
|
||||
];
|
||||
}
|
||||
|
||||
console.log(profile);
|
||||
|
||||
return profile;
|
||||
}
|
||||
|
||||
@@ -155,8 +156,8 @@ async function fetchLatest(channel, page, options) {
|
||||
? `${options.parameters.latest}?page=${page}&view=grid`
|
||||
: `${channel.url}/watch-newest-clips-and-scenes.html?page=${page}&view=grid`, {
|
||||
selectAll: '.item-grid-scene .grid-item',
|
||||
headers: {
|
||||
Cookie: 'ageConfirmed=true;',
|
||||
cookies: {
|
||||
ageConfirmed: true,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -171,6 +172,9 @@ async function fetchProfilePage(actorUrl) {
|
||||
const res = await unprint.get(actorUrl, {
|
||||
select: '#content',
|
||||
rejectUnauthorized: false,
|
||||
cookies: {
|
||||
ageConfirmed: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (res.ok) {
|
||||
@@ -189,10 +193,14 @@ async function fetchProfile(baseActor, channel, include) {
|
||||
}
|
||||
}
|
||||
|
||||
const searchRes = await http.get(`https://www.adultempire.com/search/SearchAutoComplete_Agg_EmpireDTRank?search_type=Pornstars&rows=9&name_startsWith=${slugify(baseActor.name, '+')}`);
|
||||
const searchRes = await unprint.get(`https://www.adultempire.com/search/SearchAutoComplete_Agg_EmpireDTRank?search_type=Pornstars&rows=9&name_startsWith=${slugify(baseActor.name, '+')}`, {
|
||||
cookies: {
|
||||
ageConfirmed: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (searchRes.ok && searchRes.body.Results) {
|
||||
const actorResult = searchRes.body.Results.find((result) => /performer/i.test(result.BasicResponseGroup?.displaytype) && new RegExp(baseActor.name, 'i').test(result.BasicResponseGroup?.description));
|
||||
if (searchRes.ok && searchRes.data.Results) {
|
||||
const actorResult = searchRes.data.Results.find((result) => /performer/i.test(result.BasicResponseGroup?.displaytype) && new RegExp(baseActor.name, 'i').test(result.BasicResponseGroup?.description));
|
||||
|
||||
if (actorResult) {
|
||||
const url = `https://www.adultempire.com/${actorResult.BasicResponseGroup.id}`;
|
||||
|
||||
Reference in New Issue
Block a user