Added actor photos to Brazzers scene scrape. Added no-video poster to Score. Not flattening actor avatar fallbacks.
This commit is contained in:
10
src/media.js
10
src/media.js
@@ -93,7 +93,7 @@ async function extractItem(source) {
|
||||
return null;
|
||||
}
|
||||
|
||||
async function fetchItem(source, index, existingItemsBySource, domain, role, attempt = 1, originalSource = null) {
|
||||
async function fetchItem(source, index, existingItemsBySource, domain, role, attempt = 1, originalSource = null, sourceIndex = 0) {
|
||||
if (!source) return null;
|
||||
|
||||
try {
|
||||
@@ -106,7 +106,7 @@ async function fetchItem(source, index, existingItemsBySource, domain, role, att
|
||||
|
||||
// fallbacks provided
|
||||
return source.reduce(
|
||||
(outcome, sourceX) => outcome.catch(async () => fetchItem(sourceX, index, existingItemsBySource, domain, role, attempt, originalSource)),
|
||||
(outcome, sourceX, sourceIndexX) => outcome.catch(async () => fetchItem(sourceX, index, existingItemsBySource, domain, role, attempt, originalSource, sourceIndexX)),
|
||||
Promise.reject(new Error()),
|
||||
);
|
||||
}
|
||||
@@ -164,7 +164,11 @@ async function fetchItem(source, index, existingItemsBySource, domain, role, att
|
||||
|
||||
if (attempt < 3) {
|
||||
await Promise.delay(5000);
|
||||
return fetchItem(source, index, existingItemsBySource, domain, role, attempt + 1);
|
||||
return fetchItem(source, index, existingItemsBySource, domain, role, attempt + 1, originalSource);
|
||||
}
|
||||
|
||||
if (originalSource && sourceIndex < originalSource.length) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user