fix+feat: 修复搜狗搜索链路并新增公众号合集接口 - #6
Merged
Merged
Conversation
- album 命令:校验 --count/--max-pages 为正整数,biz/albumId 非空 - fetchAlbumArticles:count clamp 到 [1,20],网络错误带 NETWORK: 前缀与 cause - fetchAlbumArticlesAll:支持 count 与起始游标,maxPages 截断时如实返回 continueFlag - resolveResultsRealUrls:有界并发解析 + 重复链接去重 - cookie jar 按名合并而非整段覆盖,避免并发覆盖 - timeConvert 兼容单双引号;搜狗时间按北京时区常量说明 - MCP:biz/albumId 空值校验,all 模式 page 归一为 1,工具描述字段名对齐
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.
背景
mpget 已取消归档,回到独立维护。url-to-markdown 里的 search 是从 mpget 移植的,但丢了 URL 还原函数;同时 mpget 原实现存在三处缺陷。
修复(搜狗搜索链路)
link一直是搜狗中间页,realUrl恒为空。现在 search(CLI 与 MCP)默认逐条解析真实 mp.weixin.qq.com 链接,可用--no-resolve关闭。https://mp.,原代码"https://mp." + parts.join("")会拼出https://mp.https://mp...。已修正(识别已含前缀的情况)。旧测试用假样本,未暴露此问题,已换成真实抓取样本做 fixture。<span class="s2"><script>document.write(timeConvert('...'))</script></span>,原实现取到的是脚本文本。现在从timeConvert('...')提取时间戳转日期,并新增account字段(.all-time-y2,公众号名)。新增(公众号合集接口)
mpget album <biz> <albumId>:调用微信appmsgalbum接口(匿名可用),返回合集内文章列表(标题/时间/msgid/真实链接),支持翻页与--all拉全量。CLI 与 MCP(新增albumtool)双入口,skill 同步更新。测试
29 个测试全绿(原 25 + 新增 album 库/MCP 各若干),lint/prettier/tsc 通过。端到端实测:search 解析真实链接成功;album 拉取 TRAE 合集 119 篇无重复。