Added media attempt configuration, default from 3 to 2, 1 for JJ scraper.
This commit is contained in:
@@ -192,6 +192,11 @@ const { argv } = yargs
|
||||
type: 'number',
|
||||
default: config.media.limit,
|
||||
})
|
||||
.option('media-attempts', {
|
||||
describe: 'Maximum amount of retries per URL',
|
||||
type: 'number',
|
||||
default: config.media.attempts,
|
||||
})
|
||||
.option('images', {
|
||||
describe: 'Include any photos, posters or covers',
|
||||
type: 'boolean',
|
||||
|
||||
@@ -655,7 +655,7 @@ streamQueue.define('fetchStreamSource', async ({ source, tempFileTarget, hashStr
|
||||
});
|
||||
|
||||
async function fetchSource(source, baseMedia) {
|
||||
const maxAttempts = source.attempts || argv.mediaAttempts || 3;
|
||||
const maxAttempts = source.attempts || argv.mediaAttempts;
|
||||
|
||||
logger.silly(`Fetching media from ${source.src}`);
|
||||
logger.debug(`Memory usage before media fetch: ${process.memoryUsage.rss() / 1000000} MB (${source.src})`);
|
||||
|
||||
@@ -183,7 +183,7 @@ function getPhotos(query, release, context) {
|
||||
.flatMap((quality) => [
|
||||
`https://thumbs.${context.entity.slug}.com/trial/content//upload/dl03/${context.entity.slug}/${path}/${quality}/${actorSlug}_${context.entity.slug}_com-${index + 1}.jpg`,
|
||||
`https://thumbs.${context.entity.slug}.com/trial/content//upload/dl03/${context.entity.slug}/${path}/${quality}/${actorSlug}_${context.entity.slug}.com-${index + 1}.jpg`, // .com instead of _com
|
||||
]));
|
||||
]).map((src) => ({ src, attempts: 1 })));
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user