Repository navigation
feat(trending): 接入小红书热榜 - #219
Merged
Merged
Conversation
新增 xiaohongshu 信源,经 60s 聚合接口取小红书实时热点(App 接口反爬严,不自爬)。实例地址可用 API60S_BASE_URL 换成自部署;上游渠道故障时本轮抓取跳过、保留旧数据,不影响其他信源。热榜页补小红书品牌标签。 (#215)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #215
改了什么
trending_scrapers新增xiaohongshu信源(_xiaohongshu.py),经 60s 聚合 API(/v2/rednote)取小红书实时热点。小红书 App 接口反爬严、直连需伪造设备指纹(属绕反爬,不做),评估结论见 issue。API60S_BASE_URL(默认官方实例https://60s-api.viki.moe,.env 可换自部署实例),与 RSSHub 实例同一思路。SOURCE_BRAND补「小红书」品牌标签;测试补已知/未知信源标签断言。已知事实
接入时点 60s 官方实例的
/v2/rednote返回 HTTP 500(其上游小红书接口未吐数据,60s 服务端问题;文档主打端点,历史上可用)。通道恢复后本端零改动即生效。测试全部 mock,不真发请求;上线后用POST /trending/sync/xiaohongshu手动单刷可验证真实通道。Verification(本地,隔离 worktree
/tmp/topiceye-xhs)_trending-utils.test.ts覆盖:正常解析(rank/score 万单位/cover/extra)、base_url 拼接与尾斜杠清理、HTTP 500、HTTP 200 但 code=500、空数据、网络错、非 JSON 体、空标题跳过、rank 缺省回退位次。
注:并行会话的
test_full_local.sh端口约定(5544/5554)今晚互相干扰,本 PR 的全量改用自持容器(topiceye-xhs-pg,端口 5620)跑,命令与脚本等价。