mcp-scraper 0.32.1 → 0.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/api-server.cjs +15 -7
  3. package/dist/bin/api-server.cjs.map +1 -1
  4. package/dist/bin/api-server.js +2 -2
  5. package/dist/bin/mcp-scraper-cli.cjs +3 -1
  6. package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
  7. package/dist/bin/mcp-scraper-cli.js +3 -3
  8. package/dist/bin/mcp-scraper-install.cjs +1 -1
  9. package/dist/bin/mcp-scraper-install.cjs.map +1 -1
  10. package/dist/bin/mcp-scraper-install.js +1 -1
  11. package/dist/bin/mcp-stdio-server.cjs +3 -1
  12. package/dist/bin/mcp-stdio-server.cjs.map +1 -1
  13. package/dist/bin/mcp-stdio-server.js +3 -3
  14. package/dist/bin/paa-harvest.cjs +4 -2
  15. package/dist/bin/paa-harvest.cjs.map +1 -1
  16. package/dist/bin/paa-harvest.js +2 -2
  17. package/dist/{chunk-RDCCU7CQ.js → chunk-AEMABLEL.js} +5 -4
  18. package/dist/chunk-AEMABLEL.js.map +1 -0
  19. package/dist/{chunk-55M5CE5L.js → chunk-MKZIL4EA.js} +2 -2
  20. package/dist/{chunk-PTHY7NYD.js → chunk-V73MPRU6.js} +3 -1
  21. package/dist/chunk-V73MPRU6.js.map +1 -0
  22. package/dist/{chunk-2FY4VBAY.js → chunk-XEED325T.js} +3 -3
  23. package/dist/chunk-XLO5CZ6T.js +7 -0
  24. package/dist/chunk-XLO5CZ6T.js.map +1 -0
  25. package/dist/index.cjs +4 -2
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.js +2 -2
  28. package/dist/{server-GXTYKIAX.js → server-LTZDJHFG.js} +17 -11
  29. package/dist/{server-GXTYKIAX.js.map → server-LTZDJHFG.js.map} +1 -1
  30. package/dist/{worker-7DJYUACV.js → worker-ZZCZNY3R.js} +3 -3
  31. package/docs/mcp-tool-manifest.generated.json +2 -2
  32. package/package.json +1 -1
  33. package/dist/chunk-PTHY7NYD.js.map +0 -1
  34. package/dist/chunk-RDCCU7CQ.js.map +0 -1
  35. package/dist/chunk-VJBS6RPB.js +0 -7
  36. package/dist/chunk-VJBS6RPB.js.map +0 -1
  37. /package/dist/{chunk-55M5CE5L.js.map → chunk-MKZIL4EA.js.map} +0 -0
  38. /package/dist/{chunk-2FY4VBAY.js.map → chunk-XEED325T.js.map} +0 -0
  39. /package/dist/{worker-7DJYUACV.js.map → worker-ZZCZNY3R.js.map} +0 -0
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  harvest
3
- } from "./chunk-RDCCU7CQ.js";
3
+ } from "./chunk-AEMABLEL.js";
4
4
  import {
5
5
  recordVendorUsage
6
6
  } from "./chunk-MTSBI7ZH.js";
7
7
  import "./chunk-K443GQY5.js";
8
- import "./chunk-PTHY7NYD.js";
8
+ import "./chunk-V73MPRU6.js";
9
9
  import "./chunk-M2S27J6Z.js";
10
10
  import "./chunk-ICT7DDHL.js";
11
11
 
@@ -15,8 +15,9 @@ import {
15
15
  encodeUule,
16
16
  harvest,
17
17
  normalizeLocation,
18
- resolveKernelProxyId
19
- } from "./chunk-RDCCU7CQ.js";
18
+ resolveKernelProxyId,
19
+ serpArrivalUrl
20
+ } from "./chunk-AEMABLEL.js";
20
21
  import {
21
22
  HttpMcpToolExecutor,
22
23
  assessTranscriptSignal,
@@ -36,7 +37,7 @@ import {
36
37
  sanitizeAttempts,
37
38
  sanitizeHarvestResult,
38
39
  transcribeMediaUrl
39
- } from "./chunk-2FY4VBAY.js";
40
+ } from "./chunk-XEED325T.js";
40
41
  import {
41
42
  auditImages,
42
43
  buildLinkReport,
@@ -65,7 +66,7 @@ import {
65
66
  workflowOutputBaseDir,
66
67
  workflowStepCount,
67
68
  workflowSupportsSteps
68
- } from "./chunk-55M5CE5L.js";
69
+ } from "./chunk-MKZIL4EA.js";
69
70
  import "./chunk-K443GQY5.js";
70
71
  import {
71
72
  DEFAULT_MAPS_PROXY_MODE,
@@ -76,8 +77,8 @@ import {
76
77
  RawMapsHoursRowSchema,
77
78
  RawMapsOverviewSchema,
78
79
  RawMapsReviewStatsSchema
79
- } from "./chunk-PTHY7NYD.js";
80
- import "./chunk-VJBS6RPB.js";
80
+ } from "./chunk-V73MPRU6.js";
81
+ import "./chunk-XLO5CZ6T.js";
81
82
  import {
82
83
  completeExtractJob,
83
84
  countSuccessfulPages,
@@ -13083,6 +13084,7 @@ import { Hono as Hono11 } from "hono";
13083
13084
  // src/extractor/MapsSearchExtractor.ts
13084
13085
  var LOCAL_RESULTS_PAGE_LIMIT = 8;
13085
13086
  var LOCAL_RESULTS_WAIT_MS = 1e3;
13087
+ var MAPS_REDIRECT_BASE = "https://serp-redirector.vercel.app";
13086
13088
  function buildGoogleLocalResultsUrl(input) {
13087
13089
  const query = [input.query, input.location].filter(Boolean).join(" ");
13088
13090
  const params = new URLSearchParams({ q: query, udm: "1", gl: input.gl, hl: input.hl, pws: "0" });
@@ -13104,21 +13106,23 @@ var MapsSearchExtractor = class {
13104
13106
  const startMs = Date.now();
13105
13107
  const searchQuery = [options.query, options.location].filter(Boolean).join(" ");
13106
13108
  const searchUrl = buildGoogleOrganicSearchUrl(options);
13109
+ const keepDefaultProxy = !options.forceDirectEgress && options.proxyMode !== "location" && options.proxyMode !== "configured" && !options.kernelProxyId;
13107
13110
  const config = {
13108
13111
  headless: options.headless,
13109
13112
  kernelApiKey: options.kernelApiKey,
13110
13113
  kernelProxyId: options.kernelProxyId,
13111
13114
  kernelProxyResolution: options.kernelProxyResolution,
13112
13115
  proxyMode: options.proxyMode,
13113
- keepDefaultProxy: options.proxyMode !== "location" && options.proxyMode !== "configured" && !options.kernelProxyId,
13116
+ keepDefaultProxy,
13114
13117
  viewport: { width: 1280, height: 900 },
13115
13118
  locale: `${options.hl}-${options.gl.toUpperCase()}`,
13116
13119
  debug: options.debug
13117
13120
  };
13121
+ const navUrl = options.serpRedirect ? serpArrivalUrl(searchUrl, process.env.SERP_REDIRECT_BASE?.trim() || MAPS_REDIRECT_BASE) : searchUrl;
13118
13122
  try {
13119
13123
  await this.driver.launch(config);
13120
13124
  const page = this.driver.getPage();
13121
- await page.goto(searchUrl, { waitUntil: "domcontentloaded", timeout: 6e4 });
13125
+ await page.goto(navUrl, { waitUntil: "domcontentloaded", timeout: 6e4 });
13122
13126
  await page.waitForTimeout(LOCAL_RESULTS_WAIT_MS);
13123
13127
  if (await this.detectBlock(page)) throw new CaptchaError(RECAPTCHA_INSTRUCTIONS);
13124
13128
  const reachedFinder = await this.clickIntoLocalFinder(page);
@@ -13978,7 +13982,9 @@ async function runMapsSearchWithRotation(options) {
13978
13982
  ...options,
13979
13983
  proxyZip,
13980
13984
  kernelProxyId: options.proxyMode === "none" ? void 0 : resolution.kernelProxyId,
13981
- kernelProxyResolution: resolution.resolution
13985
+ kernelProxyResolution: resolution.resolution,
13986
+ serpRedirect: options.proxyMode === "none" && attemptIndex >= 1 && attemptIndex < maxAttempts - 1,
13987
+ forceDirectEgress: options.proxyMode === "none" && attemptIndex >= 1
13982
13988
  };
13983
13989
  const isHeadfulEscalation = attemptIndex === maxAttempts - 1;
13984
13990
  const baseCtx = currentCostContext();
@@ -27424,7 +27430,7 @@ app.get("/cron/tick", async (c) => {
27424
27430
  if (!process.env.CRON_SECRET || secret2 !== `Bearer ${process.env.CRON_SECRET}`) {
27425
27431
  return c.json({ error: "Unauthorized" }, 401);
27426
27432
  }
27427
- const { drainQueue } = await import("./worker-7DJYUACV.js");
27433
+ const { drainQueue } = await import("./worker-ZZCZNY3R.js");
27428
27434
  const budget = { maxJobs: 10, deadlineMs: Date.now() + 28e4 };
27429
27435
  const workflowDispatchResult = await dispatchDueWorkflowSchedules(`${new URL(c.req.url).protocol}//${new URL(c.req.url).host}`);
27430
27436
  const [results, sweepResult, reapResult, expiredResult, blobCleanup, connectedDataArtifactCleanup] = await Promise.all([
@@ -27627,4 +27633,4 @@ app.get("/blog/:slug/", (c) => {
27627
27633
  export {
27628
27634
  app
27629
27635
  };
27630
- //# sourceMappingURL=server-GXTYKIAX.js.map
27636
+ //# sourceMappingURL=server-LTZDJHFG.js.map