[feat] 无 Key 搜索层增加 You.com 免费搜索接口 / Add You.com's free no-key search to the no-key search layer
描述你的建议:
先说明:我在 You.com 工作,所以请酌情参考这个建议。
没有配置任何搜索 Key 时,联网搜索会走无 Key 搜索层,也就是解析 Bing 和 DuckDuckGo 的网页结果。这种方式依赖页面结构,页面改版后可能失效。
建议:
- 在无 Key 搜索层的最前面加一步 You.com 免费接口
https://api.you.com/v1/agents/search:无需 Key、无需注册,每天 100 次。出错或额度用完时,继续走现有的 Bing / DuckDuckGo 解析。 - 在第三方搜索服务列表里加一个可选的
you,填写 Key 后使用正式 Search API(https://ydc-index.io/v1/search),额度更高。
第 1 条会改变无 Key 用户的搜索请求先发到哪里(先 You.com,再 Bing),所以要不要做由你决定。
实现上复用 service.ts 里的 fetchJson 和 normalizeSources,改动很小。请求 You.com 时会带上 User-Agent: youdotcom-integration/codexu-note-gen,方便我们统计来源,只用于 You.com 的请求。
想先确认方向:1 和 2 都要,还是只要其中一个?确认后我再提 PR。如果不合适,直接说,我会关闭这个 issue。
I work at You.com, so treat the recommendation accordingly.
When no search key is configured, web search falls back to the no-key layer, which parses Bing and DuckDuckGo result pages. That depends on page markup and can stop working when a page changes.
Proposal:
- Add You.com's free endpoint (
https://api.you.com/v1/agents/search) as the first step of the no-key layer: no key, no account, 100 searches a day. On an error or when the quota runs out, it falls through to the existing Bing and DuckDuckGo parsing. - Add an optional
youentry to the third-party provider list that uses the keyed Search API (https://ydc-index.io/v1/search) when a key is set.
Point 1 changes where no-key searches go first (You.com, then Bing), so that's your call.
It reuses fetchJson and normalizeSources in service.ts, so the change is small. For transparency: requests to You.com would send User-Agent: youdotcom-integration/codexu-note-gen, only on You.com requests.
Do you want both, or just one? I'll open the PR once you pick. If it doesn't fit, say so and I'll close this without fuss.
非常感谢,我觉得很不错,1 和 2 都要,麻烦你提交 PR。