Improved MindGeek avatar fix.

This commit is contained in:
ThePendulum 2020-01-29 02:31:55 +01:00
parent 9c00216e62
commit 81ede3f511
1 changed files with 7 additions and 5 deletions

View File

@ -138,11 +138,13 @@ function scrapeProfile(data, html) {
if (data.height) profile.height = inchesToCm(data.height);
if (data.weight) profile.weight = lbsToKg(data.weight);
profile.avatar = data.images.card_main_rect?.[0].xl?.url
|| data.images.card_main_rect?.[0].lg?.url
|| data.images.card_main_rect?.[0].md?.url
|| data.images.card_main_rect?.[0].sm?.url
|| data.images.card_main_rect?.[0].xs?.url;
if (data.images.card_main_rect && data.images.card_main_rect[0]) {
profile.avatar = data.images.card_main_rect[0].xl?.url
|| data.images.card_main_rect[0].lg?.url
|| data.images.card_main_rect[0].md?.url
|| data.images.card_main_rect[0].sm?.url
|| data.images.card_main_rect[0].xs?.url;
}
const birthdate = qa('li').find(el => /Date of Birth/.test(el.textContent));
if (birthdate) profile.birthdate = qd(birthdate, 'span', 'MMMM Do, YYYY');