Added conditions to Tokyo Hot scraper to prevent total failure.

This commit is contained in:
DebaucheryLibrarian
2023-07-31 23:41:32 +02:00
parent d2f81d446b
commit ae64c5225f
13 changed files with 170 additions and 95 deletions

View File

@@ -19,10 +19,12 @@ function scrapeAll(scenes, channel) {
const poster = query.img();
release.poster = [
poster.replace('220x124', '820x462'),
poster,
];
if (poster) {
release.poster = [
poster.replace('220x124', '820x462'),
poster,
];
}
return release;
});
@@ -59,12 +61,12 @@ function scrapeScene({ query }, url, channel) {
release.photos = query.imgs('.scap a', { attribute: 'href' }).map((img) => [
img,
img.replace('640x480_wlimited', '150x150_default'),
img?.replace('640x480_wlimited', '150x150_default'),
]);
release.caps = query.imgs('.vcap a', { attribute: 'href' }).map((img) => [
img,
img.replace('640x480_wlimited', '120x120_default'),
img?.replace('640x480_wlimited', '120x120_default'),
]);
return release;
@@ -109,7 +111,7 @@ function scrapeProfile({ query }) {
profile.hairStyle = bio.hair_style;
profile.shoeSize = getMeasurement(bio.shoes_size);
profile.bloodType = bio.blood_type.replace('type', '').trim();
profile.bloodType = bio.blood_type?.replace('type', '').trim();
profile.avatar = query.img('#profile img');