polite-crawler 0.5.0 → 0.5.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.
- package/README.md +1 -0
- package/build/{browser-56dBBLec.mjs → browser-DCd_d0oU.mjs} +5 -10
- package/build/{browser-56dBBLec.mjs.map → browser-DCd_d0oU.mjs.map} +1 -1
- package/build/classify.d.mts +0 -2
- package/build/classify.mjs +1 -2
- package/build/{cli-daemon-kNj07eYU.mjs → cli-daemon-DS9VW9TE.mjs} +3 -4
- package/build/{cli-daemon-kNj07eYU.mjs.map → cli-daemon-DS9VW9TE.mjs.map} +1 -1
- package/build/{cli-recipes-DB3PgVig.mjs → cli-recipes-P-PWShTv.mjs} +4 -5
- package/build/{cli-recipes-DB3PgVig.mjs.map → cli-recipes-P-PWShTv.mjs.map} +1 -1
- package/build/cli.mjs +16 -19
- package/build/cli.mjs.map +1 -1
- package/build/{daemon-DePmNqn9.mjs → daemon-BLROPytu.mjs} +7 -13
- package/build/{daemon-DePmNqn9.mjs.map → daemon-BLROPytu.mjs.map} +1 -1
- package/build/{diff-Db1AmXuk.mjs → diff-CIQKMarF.mjs} +5 -12
- package/build/{diff-Db1AmXuk.mjs.map → diff-CIQKMarF.mjs.map} +1 -1
- package/build/{extract-D4J0D0IZ.mjs → extract-D2YmrT0i.mjs} +7 -12
- package/build/{extract-D4J0D0IZ.mjs.map → extract-D2YmrT0i.mjs.map} +1 -1
- package/build/hours.d.mts +0 -2
- package/build/hours.mjs +1 -2
- package/build/{html-Dir5QEi0.mjs → html-CawWTgMQ.mjs} +4 -6
- package/build/{html-Dir5QEi0.mjs.map → html-CawWTgMQ.mjs.map} +1 -1
- package/build/{html-o5bDHjNi.d.mts → html-oS_ueu9U.d.mts} +2 -20
- package/build/html.d.mts +2 -1
- package/build/html.mjs +2 -2
- package/build/index.d.mts +8 -72
- package/build/index.mjs +20 -19
- package/build/{log-CmBWcyQm.mjs → log-CB5bADmd.mjs} +3 -5
- package/build/{log-CmBWcyQm.mjs.map → log-CB5bADmd.mjs.map} +1 -1
- package/build/{mcp-package-Y0bREnOS.mjs → mcp-package-D9ACY0Ux.mjs} +2 -3
- package/build/{mcp-package-Y0bREnOS.mjs.map → mcp-package-D9ACY0Ux.mjs.map} +1 -1
- package/build/{ollama-D1xRh3hY.mjs → ollama-BDZjLDOK.mjs} +4 -10
- package/build/{ollama-D1xRh3hY.mjs.map → ollama-BDZjLDOK.mjs.map} +1 -1
- package/build/{open-EuCYPZVC.mjs → open-CzT5CxKp.mjs} +23 -40
- package/build/{open-EuCYPZVC.mjs.map → open-CzT5CxKp.mjs.map} +1 -1
- package/build/politeness.d.mts +0 -2
- package/build/politeness.mjs +1 -2
- package/build/{recipe-uLu2GLkr.mjs → recipe-BEVepXSz.mjs} +5 -6
- package/build/{recipe-uLu2GLkr.mjs.map → recipe-BEVepXSz.mjs.map} +1 -1
- package/build/{recipe-product-C_zv5j3z.mjs → recipe-product-Dg65y6rc.mjs} +7 -9
- package/build/{recipe-product-C_zv5j3z.mjs.map → recipe-product-Dg65y6rc.mjs.map} +1 -1
- package/build/{render-CKE2LILH.mjs → render-B0NrFDkJ.mjs} +9 -3
- package/build/render-B0NrFDkJ.mjs.map +1 -0
- package/build/robots.d.mts +0 -2
- package/build/robots.mjs +1 -2
- package/build/{rolldown-runtime-8H4AJuhK.mjs → rolldown-runtime-BJohB4LM.mjs} +1 -2
- package/build/{runtime-ByOn76mm.mjs → runtime-ULMw0s6S.mjs} +13 -20
- package/build/{runtime-ByOn76mm.mjs.map → runtime-ULMw0s6S.mjs.map} +1 -1
- package/build/signals.d.mts +0 -2
- package/build/signals.mjs +1 -2
- package/build/{transformers-BNiuiLxT.mjs → transformers-C_ziG8yf.mjs} +4 -9
- package/build/{transformers-BNiuiLxT.mjs.map → transformers-C_ziG8yf.mjs.map} +1 -1
- package/build/urls.d.mts +28 -0
- package/build/{urls-BHFeSyEK.mjs → urls.mjs} +3 -4
- package/build/urls.mjs.map +1 -0
- package/build/{version-D4u8ScwH.mjs → version-LievpnIo.mjs} +4 -6
- package/build/{version-D4u8ScwH.mjs.map → version-LievpnIo.mjs.map} +1 -1
- package/build/{wacz-DlGT0YXp.mjs → wacz-NIMFWtd2.mjs} +7 -9
- package/build/{wacz-DlGT0YXp.mjs.map → wacz-NIMFWtd2.mjs.map} +1 -1
- package/build/{warc-Cq3gO3NK.mjs → warc-s2-0vLhN.mjs} +7 -17
- package/build/{warc-Cq3gO3NK.mjs.map → warc-s2-0vLhN.mjs.map} +1 -1
- package/build/{webbotauth-Dq_dA_u3.mjs → webbotauth-W3GXY3dy.mjs} +4 -11
- package/build/{webbotauth-Dq_dA_u3.mjs.map → webbotauth-W3GXY3dy.mjs.map} +1 -1
- package/package.json +5 -1
- package/build/render-CKE2LILH.mjs.map +0 -1
- package/build/urls-BHFeSyEK.mjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { o as decodeBody, r as typesOf, t as extractPage } from "./html-CawWTgMQ.mjs";
|
|
2
|
+
import { cacheKeyOf, canonicalUrl } from "./urls.mjs";
|
|
3
3
|
import { classify, isClientError, parseHttpDate } from "./classify.mjs";
|
|
4
4
|
import { DEFAULT_POLICY, HostScheduler, HostStopped, MAX_STOP_MS, checkPolicy, equalJitterMs, policyFor, realClock, restAfter, validatorsToSend } from "./politeness.mjs";
|
|
5
|
+
import { n as RenderRefused } from "./render-B0NrFDkJ.mjs";
|
|
5
6
|
import { decide, isProductToken, robotsFromResponse, robotsFromStatus, signalsFor, unreachableRobots } from "./robots.mjs";
|
|
6
7
|
import { NO_SIGNALS, metaSignals, readSignals } from "./signals.mjs";
|
|
7
|
-
import { n as
|
|
8
|
-
import { a as signerOf } from "./webbotauth-
|
|
9
|
-
import { o as decodeBody, r as typesOf, t as extractPage } from "./html-Dir5QEi0.mjs";
|
|
8
|
+
import { n as DEFAULT_TOKEN } from "./version-LievpnIo.mjs";
|
|
9
|
+
import { a as signerOf } from "./webbotauth-W3GXY3dy.mjs";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
11
|
import { Transform } from "node:stream";
|
|
12
12
|
import { brotliDecompressSync, constants, createBrotliDecompress, createGunzip, createInflate, createInflateRaw, gunzipSync, inflateRawSync, inflateSync } from "node:zlib";
|
|
@@ -14,7 +14,7 @@ import { Agent, request } from "undici";
|
|
|
14
14
|
import { lookup } from "node:dns";
|
|
15
15
|
import { isIP } from "node:net";
|
|
16
16
|
import { getDocumentProxy, getMeta } from "unpdf";
|
|
17
|
-
|
|
17
|
+
// src/egress.ts
|
|
18
18
|
/**
|
|
19
19
|
* The connection hook gives this error when the policy refuses each address of a host.
|
|
20
20
|
*
|
|
@@ -396,8 +396,7 @@ const egressError = (error) => {
|
|
|
396
396
|
current = current.cause;
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
|
-
|
|
400
|
-
//#region src/record.ts
|
|
399
|
+
// src/record.ts
|
|
401
400
|
/**
|
|
402
401
|
* This function writes a value as JSON with the keys of each object in sorted order. Equal values
|
|
403
402
|
* thus always give equal text, and equal text gives an equal hash.
|
|
@@ -436,8 +435,7 @@ const makeRecord = (input) => {
|
|
|
436
435
|
...input.labels !== void 0 && Object.keys(input.labels).length > 0 ? { labels: { ...input.labels } } : {}
|
|
437
436
|
};
|
|
438
437
|
};
|
|
439
|
-
|
|
440
|
-
//#region src/crawler.ts
|
|
438
|
+
// src/crawler.ts
|
|
441
439
|
/**
|
|
442
440
|
* The note of a request starts with this text when its host was not free before its deadline, so the request did not start.
|
|
443
441
|
*
|
|
@@ -2475,8 +2473,7 @@ var Crawler = class {
|
|
|
2475
2473
|
return this.closingDone;
|
|
2476
2474
|
}
|
|
2477
2475
|
};
|
|
2478
|
-
|
|
2479
|
-
//#region src/fold.ts
|
|
2476
|
+
// src/fold.ts
|
|
2480
2477
|
const MARK = /\p{M}/u;
|
|
2481
2478
|
const NONSPACING = /[\p{Mn}\p{Me}]/gu;
|
|
2482
2479
|
const IGNORABLE = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
@@ -2760,8 +2757,7 @@ const snippetOf = (text, terms, width = 160) => {
|
|
|
2760
2757
|
const clean = (part) => part.replace(/\s+/g, " ");
|
|
2761
2758
|
return `${from > 0 ? "…" : ""}${clean(text.slice(from, start))}[${clean(text.slice(start, end))}]${clean(text.slice(end, to))}${to < text.length ? "…" : ""}`;
|
|
2762
2759
|
};
|
|
2763
|
-
|
|
2764
|
-
//#region src/pdf.ts
|
|
2760
|
+
// src/pdf.ts
|
|
2765
2761
|
const MAX_PAGES = 500;
|
|
2766
2762
|
const MAX_CHARS = 2e5;
|
|
2767
2763
|
const TIME_BUDGET_MS = 2e4;
|
|
@@ -2925,8 +2921,7 @@ const readPdf = async (bytes, options = {}) => {
|
|
|
2925
2921
|
await pdf.loadingTask.destroy();
|
|
2926
2922
|
}
|
|
2927
2923
|
};
|
|
2928
|
-
|
|
2929
|
-
//#region src/fallback.ts
|
|
2924
|
+
// src/fallback.ts
|
|
2930
2925
|
/** The recipe of the request for an archived copy. Its extractor reads a Wayback Machine copy or a Common Crawl WARC record. */
|
|
2931
2926
|
const ARCHIVE_COPY_RECIPE = "archive-copy";
|
|
2932
2927
|
/** The recipe of the requests to the indexes of the archives. They give no document. */
|
|
@@ -3436,8 +3431,7 @@ const archivedPage = async (runtime, url, live, options) => {
|
|
|
3436
3431
|
notes: []
|
|
3437
3432
|
};
|
|
3438
3433
|
};
|
|
3439
|
-
|
|
3440
|
-
//#region src/runtime.ts
|
|
3434
|
+
// src/runtime.ts
|
|
3441
3435
|
/**
|
|
3442
3436
|
* This function gives the document id of a web page. Each page has one id.
|
|
3443
3437
|
*
|
|
@@ -4390,7 +4384,6 @@ const catchUpIndex = async (runtime) => {
|
|
|
4390
4384
|
errors: tally.errors
|
|
4391
4385
|
};
|
|
4392
4386
|
};
|
|
4393
|
-
//#endregion
|
|
4394
4387
|
export { DEADLINE_NOTE as A, fold as C, snippetOf as D, parseQuery as E, EgressRefused as F, egressLookup as I, makeRecord as M, sha256 as N, CAPTURE_SCHEMA as O, stableStringify as P, readPdf as S, locate as T, archivedDocId as _, fetchPage as a, fallbackReason as b, isHeldBack as c, recordOverride as d, reindex as f, archivedCopy as g, archiveExtractor as h, fetchAndIndex as i, DEFAULT_SECRET_PARAMS as j, Crawler as k, isoTime as l, versionAtTime as m, HELD_BACK as n, findDocuments as o, verifyQuote as p, catchUpIndex as r, heldBackMeta as s, Extractors as t, readDocument as u, archivedNote as v, foldText as w, isPdf as x, archivedOf as y };
|
|
4395
4388
|
|
|
4396
|
-
//# sourceMappingURL=runtime-
|
|
4389
|
+
//# sourceMappingURL=runtime-ULMw0s6S.mjs.map
|