Compare commits

..

1 Commits

Author SHA1 Message Date
orangecoding
51b4e51f3f fixing setting kleinanzeigen listings to inactive if not available anymore 2026-01-16 11:36:51 +01:00
3 changed files with 4 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
*/ */
import * as utils from '../utils.js'; import * as utils from '../utils.js';
import checkIfListingIsActive from '../services/listings/listingActiveTester.js';
let appliedBlackList = []; let appliedBlackList = [];
@@ -40,6 +41,7 @@ const config = {
}, },
normalize: normalize, normalize: normalize,
filter: applyBlacklist, filter: applyBlacklist,
activeTester: checkIfListingIsActive,
}; };
export const init = (sourceConfig, blacklistTerms) => { export const init = (sourceConfig, blacklistTerms) => {

View File

@@ -26,6 +26,7 @@ export default async function checkIfListingIsActive(link) {
for (let attempt = 1; attempt <= maxAttempts; attempt++) { for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try { try {
const res = await fetch(link, { const res = await fetch(link, {
redirect: 'manual',
headers: { headers: {
'User-Agent': 'User-Agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36',

View File

@@ -1,6 +1,6 @@
{ {
"name": "fredy", "name": "fredy",
"version": "18.0.1", "version": "18.0.2",
"description": "[F]ind [R]eal [E]states [d]amn eas[y].", "description": "[F]ind [R]eal [E]states [d]amn eas[y].",
"scripts": { "scripts": {
"prepare": "husky", "prepare": "husky",