fix: KöPi - data: URL crash behoben, Prospekte Links korrigiert
This commit is contained in:
@@ -94,7 +94,7 @@ async function scrapeMarktguru() {
|
|||||||
const cookieStr = cookies.map(c => `${c.name}=${c.value}`).join('; ');
|
const cookieStr = cookies.map(c => `${c.name}=${c.value}`).join('; ');
|
||||||
|
|
||||||
await Promise.all(offers.map(offer => new Promise(resolve => {
|
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, {
|
const req = require('https').get(offer.image, {
|
||||||
headers: {
|
headers: {
|
||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
|
'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,
|
validFrom: c.validFrom || null,
|
||||||
validTo: c.validUntil || null,
|
validTo: c.validUntil || null,
|
||||||
pageCount: c.pageCount || 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),
|
isTarget: isTargetRetailer(pub),
|
||||||
badges: c.contentBadges?.map(b => b.name) || [],
|
badges: c.contentBadges?.map(b => b.name) || [],
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user