RSSHub icon indicating copy to clipboard operation
RSSHub copied to clipboard

🔴 v2ex/topics/hot 出现错误

Open Thomas-Harrell opened this issue 2 months ago • 4 comments

路由地址

/v2ex/topics/:type

完整路由地址

/v2ex/topics/hot

相关文档

https://docs.rsshub.app/zh/routes/v2ex#v2ex-topics-type

预期是什么?

正常抓取

实际发生了什么?

官方演示的正常,但自建的出现错误。

也测试过公共实例里面的,同样会报错。

Image

部署

自建

部署相关信息

No response

额外信息

Helpful Information

Error Message:
FetchError: [GET] "https://www.v2ex.com/api/topics/hot.json": 403 Forbidden

Route: /v2ex/topics/:type

Full Route: /v2ex/topics/hot

Node Version: v24.21.0

Git Hash: f99e982c

Git Date: Sat, 19 Sep 2026 19:21:19 GMT

这不是重复的 issue

  • [x] 我已经搜索了 现有 issue,以确保该错误尚未被报告。

Thomas-Harrell avatar Sep 21 '26 17:09 Thomas-Harrell

Searching for maintainers:
  • /v2ex/topics/:type: @WhiteWorld

To maintainers: if you are not willing to be disturbed, list your username in scripts/workflow/test-issue/call-maintainer.js. In this way, your username will be wrapped in an inline code block when tagged so you will not be notified.

If all routes can not be found, the issue will be closed automatically. Please use NOROUTE for a route-irrelevant issue or leave a comment if it is a mistake. 如果所有路由都无法匹配,issue 将会被自动关闭。如果 issue 和路由无关,请使用 NOROUTE 关键词,或者留下评论。我们会重新审核。

github-actions[bot] avatar Sep 21 '26 17:09 github-actions[bot]

This issue might be a duplicate of existing issues. Please check:

  • #17825: Same route /v2ex/topics/hot with identical error FetchError: [GET] "https://www.v2ex.com/api/topics/hot.json": 403 Forbidden
  • #14440: Same route /v2ex/topics/hot reporting 403 Forbidden

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Sep 21 '26 17:09 github-actions[bot]

  • 底层真正发起 HTTPS 连接的仍然是 Node.js 的 undici(基于 OpenSSL),它的 TLS ClientHello / JA3-JA4 / HTTP2 指纹和真实 Chrome 浏览器完全不同。Cloudflare 的 bot 管理是会同时看「声称的身份」和「实际连接指纹」是否吻合的——一个自称"Chrome on macOS"、却用 Node/undici 指纹连过来的请求,正是典型的"伪装不一致"信号,很容易被判定为 bot 并返回 403。

  • rsshub 容器内 curl -Iv https://www.v2ex.com 看下返回是 200 还是 40x
  • 如果是 200 ,可以检查下 RSSHub 容器是否设置了 UA 环境,建议增加 NO_RANDOM_UA=true ( 此时 UA 会使用 RSSHub/1.0 (+http://github.com/DIYgod/RSSHub; like FeedFetcher-Google),可以确保 UA / TLS 指纹一致
  • 或者增加 UA 参数 比如 UA: 'Mozilla/5.0 xxxxxxx' (该信息非完整 UA 已截断)
  • 同时降低刷新批率,本质是 Cloudflare 规则收紧并触发了风控

iatman avatar Sep 22 '26 03:09 iatman

@iatman

问题解决了,谢谢你。

容器内 curl 命令返回的是 HTTP/2 200。

部署时添加环境变量 NO_RANDOM_UA=true 就可以了。

我 RSS 订阅的抓取频率一直都是用的 180 分钟。

Thomas-Harrell avatar Sep 22 '26 07:09 Thomas-Harrell