Compare commits

..

No commits in common. "6e79112f3adf0f6ed9ba4093c5523c6ed6b70a56" and "9331c0af5287bcf3beba9a961fb6f1fcb4f9954d" have entirely different histories.

5 changed files with 12 additions and 46 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "traxxx",
"version": "1.228.27",
"version": "1.228.26",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "traxxx",
"version": "1.228.27",
"version": "1.228.26",
"license": "ISC",
"dependencies": {
"@casl/ability": "^5.2.2",

View File

@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.228.27",
"version": "1.228.26",
"description": "All the latest porn releases in one place",
"main": "src/app.js",
"scripts": {

View File

@ -416,7 +416,7 @@ async function curateProfile(profile, actor) {
curatedProfile.hip = Number(profile.hip) || profile.hip?.match?.(/\d+/)?.[0] || null;
// combined measurement value
const measurements = profile.measurements?.match(/(\d+)(\w+)\s*[-x]\s*(\d+)\s*[-x]\s*(\d+)/); // ExCoGi uses x, Jules Jordan has spaces between the dashes
const measurements = profile.measurements?.match(/(\d+)(\w+)[-x](\d+)[-x](\d+)/); // ExCoGi uses x
if (measurements) {
curatedProfile.bust = Number(measurements[1]);
@ -610,14 +610,6 @@ async function interpolateProfiles(actorIdsOrNames) {
.filter((avatar) => avatar && (avatar.entropy === null || avatar.entropy > 5.5))
.sort((avatarA, avatarB) => avatarB.height - avatarA.height)[0]?.id || null;
if (!profile.avatar_media_id) {
// try to settle for low quality avatar
profile.avatar_media_id = actorProfiles
.map((actorProfile) => actorProfile.avatar)
.filter((avatar) => avatar)
.sort((avatarA, avatarB) => avatarB.height - avatarA.height)[0]?.id || null;
}
return profile;
});

View File

@ -353,6 +353,8 @@ async function extractSource(baseSource, { existingExtractMediaByUrl }) {
if (typeof baseSource.defer === 'function') {
const src = await baseSource.defer();
console.log(baseSource, src);
return {
...baseSource,
...toBaseSource(src),

View File

@ -3,6 +3,7 @@
const util = require('util');
const Promise = require('bluebird');
const cheerio = require('cheerio');
const { JSDOM } = require('jsdom');
const moment = require('moment');
const unprint = require('unprint');
@ -271,8 +272,9 @@ function scrapeMovie({ el, query }, url, site) {
};
}
/*
function scrapeProfile(html, url, actorName, entity) {
const { document } = new JSDOM(html).window;
const bio = document.querySelector('.model_bio').textContent;
const avatarEl = document.querySelector('.model_bio_pic img, .model_bio_thumb');
@ -318,36 +320,6 @@ function scrapeProfile(html, url, actorName, entity) {
return profile;
}
*/
function scrapeProfile({ query }, url, name, entity) {
const profile = { url };
profile.description = query.content('//comment()[contains(., " Bio Extra Field ")]/following-sibling::span'); // the spaces are important to avoid selecting a similar comment
profile.height = heightToCm(query.content('//span[contains(text(), "Height")]/following-sibling::span'));
profile.measurements = query.content('//span[contains(text(), "Measurements")]/following-sibling::span');
const age = query.content('//span[contains(text(), "Age")]/following-sibling::span')?.trim();
if (age && /\w+ \d+, \d{4}/.test(age)) {
profile.dateOfBirth = unprint.extractDate(age, 'MMMM D, YYYY');
} else {
profile.age = Number(age) || null;
}
profile.avatar = [
query.img('.model_bio_pic img, .model_bio_thumb', { attribute: 'src0_3x' }),
query.img('.model_bio_pic img, .model_bio_thumb', { attribute: 'src0_2x' }),
query.img('.model_bio_pic img, .model_bio_thumb', { attribute: 'src0_1x' }),
query.img('.model_bio_pic img, .model_bio_thumb', { attribute: 'src0' }),
query.img('.model_bio_pic img, .model_bio_thumb', { attribute: 'src' }),
].filter(Boolean);
profile.scenes = scrapeAll(unprint.initAll(query.all('.grid-item')), entity, true);
return profile;
}
async function fetchLatest(site, page = 1, include, preData, entryIdFromTitle = false) {
const url = site.parameters?.latest
@ -404,10 +376,10 @@ async function fetchProfile({ name: actorName, url }, entity) {
return null;
}
const res = await unprint.get(profileUrl);
const res = await http.get(profileUrl);
if (res.ok) {
return scrapeProfile(res.context, profileUrl, actorName, entity);
if (res.statusCode === 200) {
return scrapeProfile(res.body.toString(), profileUrl, actorName, entity);
}
return null;