Added conditions to Tokyo Hot scraper to prevent total failure.
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user