Fixed MYLF scraper failing when channel is missing, fixed profile measurement matching. Added MYLF Selects channel.

This commit is contained in:
DebaucheryLibrarian 2021-03-29 22:47:43 +02:00
parent e643e0a924
commit 010da8954b
2 changed files with 14 additions and 6 deletions

View File

@ -5263,6 +5263,15 @@ const sites = [
id: 'mylfwood',
},
},
{
slug: 'mylfselects',
name: 'MYLF Selects',
url: 'https://www.mylf.com/series/selects',
parent: 'mylf',
parameters: {
id: 'selects',
},
},
{
slug: 'stayhomemilf',
name: 'StayHomeMilf',

View File

@ -15,7 +15,7 @@ function getChannelSlug(channelName, entity) {
const channelSlug = slugify(channelName, '', { removePunctuation: true });
const channel = entity.children.find(child => new RegExp(channelSlug).test(child.slug));
return channel.slug;
return channel?.slug || null;
}
function scrapeScene(scene, channel) {
@ -70,10 +70,9 @@ function scrapeProfile(actor, entity) {
}, {});
// birthdate seems never/rarely correct
const measurements = bio.measurements?.match(/Measurements: (\d+)(\w+)-(\d+)-(\d+)/i);
if (measurements) {
[profile.bust, profile.cup, profile.waist, profile.hip] = measurements.slice(1);
if (bio.measurements) {
profile.measurements = bio.measurements;
} else {
const breastSize = actor.bio.breastSize?.match(/(\d+)(\w+)/)?.slice(1) || actor.bio.about.match(/Measurements: (\d+)(\w+)/)?.slice(1);
@ -144,8 +143,8 @@ async function fetchProfile(baseActor, { entity, parameters }) {
const url = format(parameters.profiles, { slug: baseActor.slug });
const res = await qu.get(url);
if (res.ok) {
return scrapeProfile(res.body, entity);
if (res.ok && res.body) {
return scrapeProfile(res.body._source, entity);
}
return res.status;