Update single_url.ts
This commit is contained in:
parent
d8ee4e90d6
commit
68838c9e0d
@ -20,10 +20,15 @@ export async function generateRequestParams(
|
||||
headers: { "ScrapingService-Request": "TRUE" },
|
||||
};
|
||||
|
||||
const urlKey = new URL(url).hostname;
|
||||
if (urlSpecificParams.hasOwnProperty(urlKey)) {
|
||||
return { ...defaultParams, ...urlSpecificParams[urlKey] };
|
||||
} else {
|
||||
try {
|
||||
const urlKey = new URL(url).hostname;
|
||||
if (urlSpecificParams.hasOwnProperty(urlKey)) {
|
||||
return { ...defaultParams, ...urlSpecificParams[urlKey] };
|
||||
} else {
|
||||
return defaultParams;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error generating URL key: ${error}`);
|
||||
return defaultParams;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user