diff --git a/api/src/processing/services/pinterest.js b/api/src/processing/services/pinterest.js index b4ab8ddb..c21400e1 100644 --- a/api/src/processing/services/pinterest.js +++ b/api/src/processing/services/pinterest.js @@ -3,7 +3,7 @@ import { resolveRedirectingURL } from "../url.js"; const videoRegex = /"url":"(https:\/\/v1\.pinimg\.com\/videos\/.*?)"/g; const imageRegex = /src="(https:\/\/i\.pinimg\.com\/.*\.(jpg|gif))"/g; -const validPinRegex = /"__typename"\s*:\s*"PinNotFound"/; +const notFoundRegex = /"__typename"\s*:\s*"PinNotFound"/; export default async function(o) { let id = o.id; @@ -20,9 +20,9 @@ export default async function(o) { headers: { "user-agent": genericUserAgent } }).then(r => r.text()).catch(() => {}); - const invalidPin = html.match(validPinRegex); + const invalidPin = html.match(notFoundRegex); - if (invalidPin) return { error: "fetch.empty" } + if (invalidPin) return { error: "fetch.empty" }; if (!html) return { error: "fetch.fail" };