From 010da8954b296b739d9045af36c988bb246150e0 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Mon, 29 Mar 2021 22:47:43 +0200 Subject: [PATCH] Fixed MYLF scraper failing when channel is missing, fixed profile measurement matching. Added MYLF Selects channel. --- seeds/02_sites.js | 9 +++++++++ src/scrapers/teamskeet.js | 11 +++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/seeds/02_sites.js b/seeds/02_sites.js index e7b9f3c8..74da9817 100644 --- a/seeds/02_sites.js +++ b/seeds/02_sites.js @@ -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', diff --git a/src/scrapers/teamskeet.js b/src/scrapers/teamskeet.js index 7abc9cee..50fbfeed 100644 --- a/src/scrapers/teamskeet.js +++ b/src/scrapers/teamskeet.js @@ -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;