From 66919b509a4b282755857a5af6863aa3e0accb09 Mon Sep 17 00:00:00 2001 From: Dicken Date: Thu, 9 Jul 2026 09:45:03 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20K=C3=B6Pi=20-=20data:=20URL=20crash=20be?= =?UTF-8?q?hoben,=20Prospekte=20Links=20korrigiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/tools/koepi/routes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/tools/koepi/routes.js b/backend/src/tools/koepi/routes.js index f952e75..9aa4348 100644 --- a/backend/src/tools/koepi/routes.js +++ b/backend/src/tools/koepi/routes.js @@ -94,7 +94,7 @@ async function scrapeMarktguru() { const cookieStr = cookies.map(c => `${c.name}=${c.value}`).join('; '); await Promise.all(offers.map(offer => new Promise(resolve => { - if (!offer.image) return resolve(); + if (!offer.image || !offer.image.startsWith('https://')) return resolve(); const req = require('https').get(offer.image, { headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', @@ -214,7 +214,7 @@ async function scrapeProspekte() { validFrom: c.validFrom || null, validTo: c.validUntil || null, pageCount: c.pageCount || null, - url: `https://www.kaufda.de/Prospekte/${encodeURIComponent(pub.replace(/\s+/g,'-'))}?brochureId=${id}`, + url: `https://www.kaufda.de/Geschaefte/${encodeURIComponent(pub.replace(/\s+/g,'-'))}`, isTarget: isTargetRetailer(pub), badges: c.contentBadges?.map(b => b.name) || [], });