From 86e4fb760308e77085a8fb9e9a4cc6ae2abe5757 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Fri, 21 Jul 2023 21:58:50 +0200 Subject: [PATCH] Fixed Team Skeet profiles. --- src/actors.js | 1 + src/scrapers/teamskeet.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/actors.js b/src/actors.js index e9a0f6bc..67715abe 100755 --- a/src/actors.js +++ b/src/actors.js @@ -52,6 +52,7 @@ const hairColors = { raven: 'black', red: 'red', redhead: 'red', + 'red head': 'red', rood: 'red', blue: 'blue', green: 'green', diff --git a/src/scrapers/teamskeet.js b/src/scrapers/teamskeet.js index c1026a0d..11ef71f7 100755 --- a/src/scrapers/teamskeet.js +++ b/src/scrapers/teamskeet.js @@ -62,6 +62,8 @@ function scrapeAll(scenes, channel) { function scrapeProfile(actor, entity) { const profile = {}; + console.log(actor); + if (actor.bio.about && !/\band\b/.test(actor.bio.about)) { const bio = actor.bio.about.split(/\n/).filter(Boolean).reduce((acc, item) => { const [key, value] = item.match(/(.+): (.+)/).slice(1); @@ -149,7 +151,7 @@ async function fetchProfile(baseActor, { entity, parameters }) { const res = await qu.get(url); if (res.ok && res.body) { - return scrapeProfile(res.body._source, entity); + return scrapeProfile(res.body._source || res.body, entity); } return res.status;