Added BaDoink profile scraper. Improved convert wrapper.

This commit is contained in:
DebaucheryLibrarian
2021-02-03 21:03:35 +01:00
parent cd417f40a8
commit 79b51eca67
5 changed files with 87 additions and 9 deletions

View File

@@ -324,6 +324,7 @@ async function curateProfile(profile, actor) {
const curatedProfile = {
id: profile.id,
name: profile.name,
url: profile.url,
avatar: profile.avatar,
scraper: profile.scraper,
entity: profile.entity,
@@ -365,10 +366,22 @@ async function curateProfile(profile, actor) {
curatedProfile.height = Number(profile.height) || profile.height?.match?.(/\d+/)?.[0] || null;
curatedProfile.weight = Number(profile.weight) || profile.weight?.match?.(/\d+/)?.[0] || null;
// separate measurement values
curatedProfile.cup = profile.cup || (typeof profile.bust === 'string' && profile.bust?.match?.(/[a-zA-Z]+/)?.[0]) || null;
curatedProfile.bust = Number(profile.bust) || profile.bust?.match?.(/\d+/)?.[0] || null;
curatedProfile.waist = Number(profile.waist) || profile.waist?.match?.(/\d+/)?.[0] || null;
curatedProfile.hip = Number(profile.hip) || profile.hip?.match?.(/\d+/)?.[0] || null;
// combined measurement value
const measurements = profile.measurements?.match(/(\d+)(\w+)-(\d+)-(\d+)/);
if (measurements) {
curatedProfile.bust = Number(measurements[1]);
curatedProfile.cup = measurements[2];
curatedProfile.waist = Number(measurements[3]);
curatedProfile.hip = Number(measurements[4]);
}
curatedProfile.penisLength = Number(profile.penisLength) || profile.penisLength?.match?.(/\d+/)?.[0] || null;
curatedProfile.penisGirth = Number(profile.penisGirth) || profile.penisGirth?.match?.(/\d+/)?.[0] || null;