@fffangchenghao/dsh-web-search 0.13.0 → 0.13.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/CHANGELOG.md +13 -0
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.2
|
|
4
|
+
|
|
5
|
+
### Documentation
|
|
6
|
+
- The READMEs point at npm for the current version instead of repeating a number
|
|
7
|
+
that goes stale the moment a release is cut.
|
|
8
|
+
|
|
9
|
+
## 0.13.1
|
|
10
|
+
|
|
11
|
+
### Documentation
|
|
12
|
+
- `read_page`'s page cache is keyed by URL, output format and the fetch settings
|
|
13
|
+
that shape the result — including the AnySearch key. The READMEs now say so,
|
|
14
|
+
and the test count matches what the suite actually reports.
|
|
15
|
+
|
|
3
16
|
## 0.13.0
|
|
4
17
|
|
|
5
18
|
### Added
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
- [中文说明](README.zh-CN.md)
|
|
6
6
|
- [Changelog](CHANGELOG.md) · [Why a plugin's settings go missing: the four-layer chain](docs/plugin-settings-form.md)
|
|
7
7
|
|
|
8
|
-
>
|
|
8
|
+
> The latest version and install command live on [npm](https://www.npmjs.com/package/@fffangchenghao/dsh-web-search); no version number is hard-coded here, so the docs cannot drift from the release. What follows starts with what this means for you; the technical detail is collected in the appendix.
|
|
9
9
|
|
|
10
10
|
## In one sentence
|
|
11
11
|
|
|
@@ -746,7 +746,7 @@ Arguments: `url` (required), `offset` (optional, default `0`, zero-based), `maxL
|
|
|
746
746
|
|
|
747
747
|
Returns: `url`, `content` (this chunk's text), `offset`, `nextOffset` (the offset to pass next; `null` when finished), `totalLength` (whole-body length), `truncated` (whether the source itself was cut: the 2,000,000-character cap or the transport), `chunk` (`index` is 1-based, `count` is estimated for this call's `maxLength`), and `failures` (fetch failures, shaped like `domain_search` / `search_many`).
|
|
748
748
|
|
|
749
|
-
Cache: a successful body is cached per URL, output format and fetch-affecting settings, up to eight pages with least-recently-used eviction; walking a page chunk by chunk therefore fetches it once, and only a format change or a change to proxy, timeout
|
|
749
|
+
Cache: a successful body is cached per URL, output format and fetch-affecting settings, up to eight pages with least-recently-used eviction; walking a page chunk by chunk therefore fetches it once, and only a format change or a change to proxy, timeout, render settings or the AnySearch key fetches it again. Failures are not cached. `content` excludes the "characters remain" hint, so concatenating the chunks reproduces the body exactly.
|
|
750
750
|
|
|
751
751
|
Boundaries: an `offset` past `totalLength` throws; `offset === totalLength` counts as finished and returns empty `content` with `nextOffset: null`; a non-http(s) URL throws; network, HTTP or blocked failures come back in `failures` instead of reaching the host; caller cancellation still throws. Offsets and lengths count JavaScript string code units, and a cut that would split a surrogate pair moves back one code unit, with `nextOffset` following the adjusted boundary.
|
|
752
752
|
|
package/README.zh-CN.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
- [English README](README.md)
|
|
6
6
|
- [更新日志](CHANGELOG.md) · [设置页为什么不显示:四层判定链](docs/plugin-settings-form.md)
|
|
7
7
|
|
|
8
|
-
>
|
|
8
|
+
> 最新版本与安装命令以 [npm 上的 latest](https://www.npmjs.com/package/@fffangchenghao/dsh-web-search) 为准(这里不写死版本号,免得文档和发布不同步)。下面先讲「它跟我有什么关系」,技术细节放在后面的附录。
|
|
9
9
|
|
|
10
10
|
## 一句话说明
|
|
11
11
|
|
|
@@ -746,7 +746,7 @@ read_page 调用
|
|
|
746
746
|
|
|
747
747
|
返回:`url`、`content`(这一段正文)、`offset`、`nextOffset`(下次该传的 offset;读完为 `null`)、`totalLength`(整页正文长度)、`truncated`(来源本身是否被截断:2,000,000 字符安全上限或传输层截断)、`chunk`(`index` 从 1 开始,`count` 按本次 `maxLength` 估算)、`failures`(抓取失败,形状与 `domain_search` / `search_many` 相同)。
|
|
748
748
|
|
|
749
|
-
缓存:成功的整页正文按「URL + 输出格式 + 影响抓取的设置」缓存,最多 8
|
|
749
|
+
缓存:成功的整页正文按「URL + 输出格式 + 影响抓取的设置」缓存,最多 8 页,按最久未用淘汰;因此一页分几段读也只抓一次,只有换格式或改代理、超时、渲染设置、AnySearch key 才会重新抓。失败不缓存。`content` 里不含「还剩多少字符」那行提示,所以各段 `content` 直接拼接就是完整正文。
|
|
750
750
|
|
|
751
751
|
边界:`offset` 超过 `totalLength` 直接报错;`offset === totalLength` 视为读完,返回空 `content` 与 `nextOffset: null`;非 http/https 报错;网络、HTTP 状态或拦截失败以 `failures` 返回,不抛给宿主;调用方取消仍然抛出。切片按 JavaScript 字符串的 code unit 计数,切点落在代理对中间时回退一个 code unit,`nextOffset` 跟着回退后的边界走。
|
|
752
752
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fffangchenghao/dsh-web-search",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "DSH bundle: a key-free web search provider. Leads with the anonymous AnySearch API and falls back to public result pages (DuckDuckGo, Bing, 360), merged by reciprocal-rank fusion with a bilingual region policy, an engine cooldown and a TTL cache.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|