Skip to content

Foresight News 路由失效 #21667

@jv43

Description

@jv43

Routes

/foresightnews
/foresightnews/article
/foresightnews/news
/foresightnews/column/1

Full routes

/foresightnews
/foresightnews/article
/foresightnews/news
/foresightnews/column/1

Related documentation

https://docs.rsshub.app/new-media.html#foresightnews

What is expected?

期望能正常获取 Foresight News 的精选资讯、文章、快讯等内容。

目前所有 /foresightnews 系列路由均返回 403(Fetch Failed),无法获取任何数据。

What is actually happening?

所有 /foresightnews/* 路由均返回 403 Forbidden(Fetch Failed)。

路由实现调用了 https://api.foresightnews.pro/v2/feed(精选)或 https://api.foresightnews.pro/v1/articles(文章)、https://api.foresightnews.pro/v1/news(快讯)等 API,返回结果以 base64 + zlib 压缩编码。

问题分析

从代码看(lib/routes/foresightnews/util.tsx + lib/utils/request-rewriter/fetch.ts),RSSHub 发出的请求:

  1. Referer 被硬编码为 API 的 origin:Referer: https://api.foresightnews.pro
  2. User-Agent 和一组 sec-ch-uasec-fetch-* 等浏览器头由 header-generator 动态生成(Node undici 栈)
  3. 无 Cookie

从同一台服务器上用浏览器可直接访问 https://api.foresightnews.pro/v2/feed?size=50,但 RSSHub 请求被 403。怀疑原因是:

  • Referer 行为不一致:官方前端从 https://foresightnews.pro/ 调用 API 时,Referer 应为主站域名,但 RSSHub 的 wrappedFetch 将 Referer 设为请求 URL 自身的 origin(即 https://api.foresightnews.pro),可能触发来源校验。
  • TLS / HTTP 指纹差异:Node undici 的 TLS 客户端指纹(JA3 等)与真实浏览器不同,可能触发 Cloudflare 或其他 WAF 的客户端指纹检测。
  • 服务器出口 IP 信誉:RSSHub 实例部署 IP 可能已被目标站拉黑。

建议排查方向

  1. 将 Referer 改为与官方前端一致(https://foresightnews.pro/
  2. 检查是否涉及 Origin 校验(如有,补充 Origin: https://foresightnews.pro
  3. 若上述均无效,可能需评估是否切换到 Puppeteer/浏览器方案(或添加代理选项供用户自行绕过)

Deployment information

Self-hosted

Deployment information (for self-hosted)

No response

Additional info

info: <-- GET /foresightnews
warn: Request https://api.foresightnews.pro/v2/feed?size=50 with error 403 remaining retry attempts: 2
error: Error in /foresightnews: FetchError: [GET] "https://api.foresightnews.pro/v2/feed?size=50": 403 Forbidden
info: --> GET /foresightnews 503 578ms
info: <-- GET /foresightnews
warn: Request https://api.foresightnews.pro/v2/feed?size=50 with error 403 remaining retry attempts: 2
error: Error in /foresightnews: FetchError: [GET] "https://api.foresightnews.pro/v2/feed?size=50": 403 Forbidden
info: --> GET /foresightnews 503 610ms
info: <-- GET /foresightnews
warn: Request https://api.foresightnews.pro/v2/feed?size=50 with error 403 remaining retry attempts: 2
error: Error in /foresightnews: FetchError: [GET] "https://api.foresightnews.pro/v2/feed?size=50": 403 Forbidden
info: --> GET /foresightnews 503 630ms
info: <-- GET /foresightnews
warn: Request https://api.foresightnews.pro/v2/feed?size=50 with error 403 remaining retry attempts: 2
error: Error in /foresightnews: FetchError: [GET] "https://api.foresightnews.pro/v2/feed?size=50": 403 Forbidden
info: --> GET /foresightnews 503 622ms
info: <-- GET /foresightnews
warn: Request https://api.foresightnews.pro/v2/feed?size=50 with error 403 remaining retry attempts: 2
error: Error in /foresightnews: FetchError: [GET] "https://api.foresightnews.pro/v2/feed?size=50": 403 Forbidden
info: --> GET /foresightnews 503 610ms
info: <-- GET /foresightnews
warn: Request https://api.foresightnews.pro/v2/feed?size=50 with error 403 remaining retry attempts: 2
error: Error in /foresightnews: FetchError: [GET] "https://api.foresightnews.pro/v2/feed?size=50": 403 Forbidden
info: --> GET /foresightnews 503 863ms
info: <-- GET /foresightnews
warn: Request https://api.foresightnews.pro/v2/feed?size=50 with error 403 remaining retry attempts: 2
error: Error in /foresightnews: FetchError: [GET] "https://api.foresightnews.pro/v2/feed?size=50": 403 Forbidden
info: --> GET /foresightnews 503 725ms

This is not a duplicated issue

  • I have searched existing issues to ensure this bug has not already been reported

Metadata

Metadata

Assignees

No one assigned

    Labels

    RSS bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions