Added Sperm Swallowers and The Ass Factory to Jules Jordan scraper. Added photo source.

This commit is contained in:
2019-12-12 05:18:43 +01:00
parent ad1a0376e7
commit a03a00f5d9
8 changed files with 43 additions and 11 deletions

View File

@@ -112,8 +112,16 @@ async function filterHashDuplicates(files, domains = ['releases'], roles = ['pho
async function fetchPhoto(photoUrl, index, identifier, attempt = 1) {
if (Array.isArray(photoUrl)) {
return fetchPhoto(photoUrl[0], index, identifier);
// return photoUrl.reduce(async (outcome, url) => outcome.catch(async () => fetchPhoto(url, index, identifier)), Promise.reject());
// return fetchPhoto(photoUrl[0], index, identifier);
return photoUrl.reduce(async (outcome, url) => outcome.catch(async () => {
const photo = await fetchPhoto(url, index, identifier);
if (photo) {
return photo;
}
throw new Error('Photo not available');
}), Promise.reject(new Error()));
}
try {
@@ -214,6 +222,8 @@ async function storePhotos(release, releaseId) {
concurrency: 10,
}).filter(photo => photo);
console.log(metaFiles);
const uniquePhotos = await filterHashDuplicates(metaFiles, 'releases', 'photo', `(${release.site.name}, ${releaseId}) "${release.title}"`);
const savedPhotos = await savePhotos(uniquePhotos, release, releaseId);