diff --git a/public/img/tags/caucasian/2.jpeg b/public/img/tags/caucasian/2.jpeg new file mode 100644 index 00000000..2ef04d57 Binary files /dev/null and b/public/img/tags/caucasian/2.jpeg differ diff --git a/public/img/tags/caucasian/lazy/2.jpeg b/public/img/tags/caucasian/lazy/2.jpeg new file mode 100644 index 00000000..c50b567b Binary files /dev/null and b/public/img/tags/caucasian/lazy/2.jpeg differ diff --git a/public/img/tags/caucasian/thumbs/0.jpeg b/public/img/tags/caucasian/thumbs/0.jpeg index 70daa559..f7ac50f9 100644 Binary files a/public/img/tags/caucasian/thumbs/0.jpeg and b/public/img/tags/caucasian/thumbs/0.jpeg differ diff --git a/public/img/tags/caucasian/thumbs/1.jpeg b/public/img/tags/caucasian/thumbs/1.jpeg index b8dcbc72..7be34d72 100644 Binary files a/public/img/tags/caucasian/thumbs/1.jpeg and b/public/img/tags/caucasian/thumbs/1.jpeg differ diff --git a/public/img/tags/caucasian/thumbs/2.jpeg b/public/img/tags/caucasian/thumbs/2.jpeg new file mode 100644 index 00000000..e2e8c9d5 Binary files /dev/null and b/public/img/tags/caucasian/thumbs/2.jpeg differ diff --git a/public/img/tags/caucasian/thumbs/poster.jpeg b/public/img/tags/caucasian/thumbs/poster.jpeg index b19caaeb..50025ffa 100644 Binary files a/public/img/tags/caucasian/thumbs/poster.jpeg and b/public/img/tags/caucasian/thumbs/poster.jpeg differ diff --git a/seeds/04_media.js b/seeds/04_media.js index 627da388..45530768 100644 --- a/seeds/04_media.js +++ b/seeds/04_media.js @@ -603,7 +603,7 @@ const tagPosters = [ ['brunette', 0, 'Darcie Dolce for Playboy'], ['bondage', 0, 'Veronica Leal for Her Limit'], ['bukkake', 0, 'Jaye Summers in "Facialized 5" for HardX'], - ['caucasian', 0, 'Remy Lacroix for HardX'], + ['caucasian', 2, 'Kenzie Reeves for Bang'], ['creampie', 'poster', 'ALina Lopez in "Making Yourself Unforgettable" for Blacked'], ['cum-in-mouth', 1, 'Sarah Vandella in "Blow Bang Vandella" for HardX'], ['cum-on-butt', 0, 'Jynx Maze in "Don\'t Make Me Beg 4" for Evil Angel'], @@ -681,6 +681,7 @@ const tagPhotos = [ ['blonde', 2, 'Isabelle Deltore for Her Limit'], ['blowbang', 'poster', 'Marsha May in "Feeding Frenzy 12" for Jules Jordan'], // ['bukkake', 'poster', 'Mia Malkova in "Facialized 2" for HardX'], + ['caucasian', 0, 'Remy Lacroix for HardX'], ['caucasian', 1, 'Sheena Shaw for Brazzers'], ['da-tp', 6, 'Adriana Chechik in "Gangbang Me" for HardX'], ['da-tp', 0, 'Natasha Teen in LegalPorno SZ2164'], diff --git a/src/media.js b/src/media.js index 672cc64d..cacd3088 100644 --- a/src/media.js +++ b/src/media.js @@ -99,6 +99,9 @@ function toBaseSource(rawSource) { baseSource.stream = rawSource.stream; } + // reject source if response mimetype does not match specified type + if (rawSource.verifyType) baseSource.verifyType = rawSource.verifyType; + if (rawSource.referer) baseSource.referer = rawSource.referer; if (rawSource.host) baseSource.host = rawSource.host; if (rawSource.attempts) baseSource.attempts = rawSource.attempts; @@ -441,6 +444,8 @@ streamQueue.define('fetchStreamSource', async ({ source, tempFileTarget, hashStr }); async function fetchSource(source, baseMedia) { + const maxAttempts = source.attempts || 3; + logger.silly(`Fetching media from ${source.src}`); // attempts @@ -470,6 +475,10 @@ async function fetchSource(source, baseMedia) { const [type, subtype] = mimetype.split('/'); const extension = mime.getExtension(mimetype); + if (source.verifyType && source.verifyType !== type) { + throw Object.assign(new Error(`Type '${type}' does not match type '${source.verifyType}' specified by source`), { code: 'VERIFY_TYPE' }); + } + return { ...source, file: { @@ -486,14 +495,15 @@ async function fetchSource(source, baseMedia) { }; } catch (error) { hasher.end(); - const maxAttempts = source.attempts || 3; - logger.warn(`Failed attempt ${attempts}/${maxAttempts} to fetch ${source.src}: ${error.message}`); + if (error.code !== 'VERIFY_TYPE') { + logger.warn(`Failed attempt ${attempts}/${maxAttempts} to fetch ${source.src}: ${error.message}`); - if (attempts < maxAttempts) { - await Promise.delay(1000); + if (attempts < maxAttempts) { + await Promise.delay(1000); - return attempt(attempts + 1); + return attempt(attempts + 1); + } } throw new Error(`Failed to fetch ${source.src}: ${error.message}`); diff --git a/src/scrapers/julesjordan.js b/src/scrapers/julesjordan.js index 05430c57..ed5b1136 100644 --- a/src/scrapers/julesjordan.js +++ b/src/scrapers/julesjordan.js @@ -160,10 +160,22 @@ function scrapeAll(scenes, site, entryIdFromTitle) { { src: prefixedSrc.replace(/.jpg$/, '-full.jpg'), referer: site.url, + verifyType: 'image', // sometimes returns 200 OK with text/html instead of 403 + }, + { + src: prefixedSrc.replace(/-1x.jpg$/, '-4x.jpg'), + referer: site.url, + verifyType: 'image', + }, + { + src: prefixedSrc.replace(/-1x.jpg$/, '-2x.jpg'), + referer: site.url, + verifyType: 'image', }, { src: prefixedSrc, referer: site.url, + verifyType: 'image', }, ]; }