Skip to content
dsh.fish
Bundle

dsh-web-search-so360

Keyless web search provider for DeepSeek Harness backed by 360 Search (so.com). 免 API Key 的 DSH 联网搜索提供方。

Source
Bronier
License
MIT
Updated
Updated 2 days ago

Readme

# dsh-web-search-so360

[中文](#简介) | [English](#english)

给 [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) 的**免 API Key** 联网搜索提供方,双引擎 fallback:360 搜索(so.com)为主,Bing 为备。

## 简介

DSH 官方的 `web_search` 走 DeepSeek 通道:需要 `DEEPSEEK_API_KEY`,且每次搜索都是一次完整的模型调用(有延迟、有 token 开销)。本插件把搜索通道替换为公开 SERP 抓取,零成本:

- ✅ **不需要任何 API Key**,零模型调用
- ✅ **双引擎 fallback**:so360 优先(中文友好),so360 失效时自动切 Bing
- ✅ **so360 引擎**:解析 360 搜索 SERP,优先读 `data-mdurl` 内嵌真实链接
- ✅ **Bing 引擎**:cookie 预热 + 直出结果,响应 <1s
- ✅ **零依赖**:仅用 Node 原生 `fetch`,无 Playwright/Puppeteer
- ✅ 返回结构化结果:标题 + 链接 + 摘要

## 安装

```sh
dsh plugin --profile desktop add github:Bronier/dsh-web-search-so360
```

安装后**重启 DSH** 生效。卸载即恢复官方通道。

## 工作原理

### so360 引擎(主)

1. 以桌面浏览器 UA 请求 `https://www.so.com/s?q=<query>`
2. 解析 `<h3 class="res-title">` 锚点,标题去标签、提取 `<p class="res-desc">` 摘要
3. 链接还原:优先读 `data-mdurl` 属性(360 内嵌真实地址),缺失时回退抓 `/link?m=...` 跳转页
4. URL 去重后返回 `{ sources, truncated: false }`

### Bing 引擎(备)

1. 访问 `https://www.bing.com/` 获取 cookie(手动 fetch redirect=manual 读取 Set-Cookie)
2. 带上 cookie 搜索 `https://www.bing.com/search?q=...&mkt=zh-CN`
3. 解析 `<li class="b_algo">` 块,解码 base64url 跳转参数拿真实 URL
4. 如果 so360 引擎失败(布局变化、反爬、零结果),自动重试 Bing

### 错误报告

所有引擎都失败时才报错,错误信息列出每个引擎的具体原因,例如:
```
so360: all engines failed (so360: no results parsed; bing: no parsable results)
```

## 配置(可选)

`apply(ctx, config)` 支持以下键:

| 键 | 默认值 | 说明 |
|---|---|---|
| `engines` | `['so360', 'bing']` | 引擎执行顺序,第一个成功的返回 |

示例:只用 Bing,不用 so360:
```yaml
# cordis.patch.yml
- insert:
    - id: web-search-so360
      name: 'dsh-web-search-so360'
      config:
        engines: ['bing']
```

## 已知限制

- 本质是公开 SERP 抓取,反爬策略变化可能导致解析失败;
- 单次最多返回首页约 10 条;
- Bing 在国内偶尔被墙,so360 更稳定;
- 请遵守目标网站服务条款,仅供个人本地研究使用。

## 致谢

- 接口契约参考 [@deepseek-ai/dsh-web-search-deepseek](https://www.npmjs.com/package/@deepseek-ai/dsh-web-search-deepseek)
- Bing cookie 预热思路参考 [aooyoo/dsh-web-search-ddg](https://github.com/aooyoo/dsh-web-search-ddg)

## 许可证

[MIT](./LICENSE) © 2026 Bronier

---

<a id="english"></a>

# dsh-web-search-so360 (English)

A **zero-API-key** dual-engine web search provider for DeepSeek Harness: **360 Search (so.com)** as primary, **Bing** as fallback.

- No API key, no model-turn cost
- Dual-engine fallback: so360 (best for Chinese queries) → Bing (sub-1s when healthy)
- so360 engine: scrapes SERP, reads `data-mdurl` for real URLs (no redirect fetch needed)
- Bing engine: cookie bootstrap + direct fetch, parses `b_algo` blocks
- Zero dependencies, native `fetch` only
- Structured results: title + url + snippet; dedup by URL

Install:
```sh
dsh plugin --profile desktop add github:Bronier/dsh-web-search-so360
```

Restart DSH afterwards. Uninstalling restores official routing automatically.

Configurable via `apply(ctx, { engines: ['so360', 'bing'] })`.

Known limits: SERP scraping may break on anti-bot/layout changes; ~10 results per page; personal local research use.

MIT © 2026 Bronier

Install

dsh plugin --profile web add github:Bronier/dsh-web-search-so360

Profile: web

  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source