forked from DebaucheryLibrarian/traxxx
Improved actor profile flow. Added images.
This commit is contained in:
@@ -119,17 +119,12 @@ async function scrapeProfile(html, _url, actorName) {
|
||||
const descriptionEl = document.querySelector('.description-box');
|
||||
const avatarEl = document.querySelector('.pornstar-details .card-img-top');
|
||||
|
||||
const country = await knex('countries')
|
||||
.where('nationality', 'ilike', `%${bio.Nationality}%`)
|
||||
.orderBy('priority', 'desc')
|
||||
.first();
|
||||
|
||||
const profile = {
|
||||
name: actorName,
|
||||
};
|
||||
|
||||
profile.birthdate = moment.utc(bio.Birthday, 'MMMM DD, YYYY').toDate();
|
||||
if (country) profile.birthPlace = country.name;
|
||||
if (bio.Nationality) profile.nationality = bio.Nationality;
|
||||
|
||||
if (bio['Bra size']) [profile.bust] = bio['Bra size'].match(/\d+\w+/);
|
||||
if (bio.Waist) profile.waist = Number(bio.Waist.match(/\d+/)[0]);
|
||||
|
||||
@@ -78,6 +78,11 @@ function scrapeProfile(html, url, actorName, siteSlug) {
|
||||
|
||||
const avatarEl = document.querySelector('img.actorPicture');
|
||||
const descriptionEl = document.querySelector('.actorBio p:not(.bioTitle)');
|
||||
const hairEl = document.querySelector('.actorProfile .attribute_hair_color');
|
||||
const heightEl = document.querySelector('.actorProfile .attribute_height');
|
||||
const weightEl = document.querySelector('.actorProfile .attribute_weight');
|
||||
const aliasEl = document.querySelector('.actorProfile .attribute_alternate_names');
|
||||
const nationalityEl = document.querySelector('.actorProfile .attribute_home');
|
||||
|
||||
const profile = {
|
||||
name: actorName,
|
||||
@@ -96,6 +101,11 @@ function scrapeProfile(html, url, actorName, siteSlug) {
|
||||
}
|
||||
|
||||
if (descriptionEl) profile.description = descriptionEl.textContent.trim();
|
||||
if (hairEl) profile.hair = hairEl.textContent.split(':')[1].trim();
|
||||
if (heightEl) profile.height = Number(heightEl.textContent.match(/\d+/)[0]);
|
||||
if (weightEl) profile.weight = Number(weightEl.textContent.match(/\d+/)[0]);
|
||||
if (aliasEl) profile.aliases = aliasEl.textContent.split(':')[1].trim().split(', ');
|
||||
if (nationalityEl) profile.nationality = nationalityEl.textContent.split(':')[1].trim();
|
||||
|
||||
profile.releases = Array.from(document.querySelectorAll('.sceneList .scene a.imgLink'), el => `https://${siteSlug}.com${el.href}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user