feat: add cookie support to kijiji scraper
Add optional cookie parameter to bypass bot detection (403 errors). Cookies can be provided via parameter, KIJIJI_COOKIE env var, or cookies/kijiji.json file. Supports both JSON array and string formats. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -115,6 +115,7 @@ export async function handleMcpRequest(req: Request): Promise<Response> {
|
||||
params.append("priceMin", args.priceMin.toString());
|
||||
if (args.priceMax)
|
||||
params.append("priceMax", args.priceMax.toString());
|
||||
if (args.cookies) params.append("cookies", args.cookies);
|
||||
|
||||
console.log(
|
||||
`[MCP] Calling Kijiji API: ${API_BASE_URL}/kijiji?${params.toString()}`,
|
||||
|
||||
@@ -52,6 +52,11 @@ export const tools = [
|
||||
type: "number",
|
||||
description: "Maximum price in cents",
|
||||
},
|
||||
cookies: {
|
||||
type: "string",
|
||||
description:
|
||||
"Optional: Kijiji session cookies to bypass bot detection (JSON array or 'name1=value1; name2=value2')",
|
||||
},
|
||||
},
|
||||
required: ["query"],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user