Fixed Bang scraper. Added Kink affiliate, tag photos.

This commit is contained in:
DebaucheryLibrarian
2021-07-05 00:06:18 +02:00
parent 4fb41a4c35
commit 23b41fc4f3
82 changed files with 225 additions and 10 deletions

View File

@@ -15,7 +15,7 @@ const genderMap = {
};
function getScreenUrl(item, scene) {
return `https://i.bang.com/screenshots/${scene.dvd.id}/movie/${scene.order}/${item.screenId}.jpg`;
return `https://i.bang.com/screenshots/${scene.dvd.id}/${scene.type}/${scene.order}/${item.screenId}.jpg`;
}
function encodeId(id) {
@@ -47,7 +47,7 @@ async function fetchPhotos(scene) {
encodeJSON: false,
});
if (res.ok) {
if (res.ok && res.body.images) {
return res.body.images.map(image => qu.prefixUrl(image, 'https://photos.bang.com'));
}
@@ -101,7 +101,7 @@ async function scrapeScene(scene, entity, options) {
}
function scrapeAll(scenes, entity) {
return scenes.map(({ _source: scene }) => scrapeScene(scene, entity));
return Promise.all(scenes.map(({ _source: scene }) => scrapeScene(scene, entity)));
}
async function fetchActorReleases(actor, entity) {