diff --git a/src/scrapers/acam.js b/src/scrapers/acam.js index 0a8d2ed6..8cfca192 100755 --- a/src/scrapers/acam.js +++ b/src/scrapers/acam.js @@ -4,9 +4,10 @@ const unprint = require('unprint'); const slugify = require('../utils/slugify'); -function extractEntryId(poster) { +function extractEntryId(posters) { try { - return slugify(new URL(poster).pathname.match(/\/images\/(.*?)\.[a-z]{3,4}/i)?.[1]?.replace(/smak.*/i, ''), ''); + const poster = [].concat(posters).filter(Boolean)[0]; + return slugify(new URL(poster.src || poster).pathname.match(/\/images\/(.*?)\.[a-z]{3,4}/i)?.[1]?.replace(/smak.*/i, ''), ''); } catch (error) { return null; } @@ -48,14 +49,26 @@ function getPhotos(poster) { if (photo === poster) { return { - poster, + poster: { + src: poster, + verifyType: 'image', + }, photos: [], }; } return { - poster: [photo, poster], - photos: [poster], + poster: [{ + src: photo, + verifyType: 'image', + }, { + src: poster, + verifyType: 'image', + }], + photos: [{ + src: poster, + verifyType: 'image', + }], }; }