feat(bilibili): 列表命令透出底层 API 已有的元数据 + 修 user-videos likes 恒为 0 - #2466
Open
huanghe wants to merge 2 commits into
Open
feat(bilibili): 列表命令透出底层 API 已有的元数据 + 修 user-videos likes 恒为 0#2466huanghe wants to merge 2 commits into
huanghe wants to merge 2 commits into
Conversation
列表类命令的底层响应里本来就带着时长 / 播放量 / 精确发布秒 / 封面 /
作者 id + 头像,只是没进 columns,下游只能在召回后再打一轮请求补抓。
这批改动零新请求、零新登录态,老列的名字和格式全部保持不变;新列一律给
数字 / unix 秒,展示串保留原列。
- feed: pub_ts / mid / face / bvid / cover / duration / duration_sec /
plays / danmaku / desc / only_fans
- user-videos: created_ts / duration / duration_sec / comments / danmaku /
bvid / cover / desc / is_pay
- search: mid / plays / likes / danmaku / favorites / duration /
duration_sec / pubdate_ts / cover / face / desc(score 仍等于 play;
user 分支补 mid / face)
- video: mid / face / pubdate_ts / duration_sec
- utils 新增 parseDurationText("24:34"→1474)、parseCountText("1.2万"→12000)、
httpsUrl(http:// 与协议相对地址升 https)
feed 的 pub_ts 实测返回字符串,统一转成数字。已重新生成 cli-manifest.json,
silent-column-drop gate 无新增违规。
arc/search 的 vlist[] 根本没有 like 字段(实测 item.like 恒 undefined), `likes: item.like ?? 0` 于是让每一条都显示 0 —— 看着像"零赞",其实是 "没这个数据",下游没法区分。 改成从 medialist(空间"播放全部"用的 /x/v2/medialist/resource/list)取 cnt_info.thumb_up:整页一次请求补齐,不是每条一次,按 aid join。窗口取 本页条数的两倍多一点(上限 50),避免 medialist 漏掉的稿件(付费课程、充电 专属之类)把后面几条挤出窗口。 新增 likes_known 列:medialist 只按发布时间倒序列稿件,--order click / stow 时多数行对不上,这些行如实报 likes: 0 + likes_known: false,不假装是零赞。 medialist 请求失败时整条命令照常返回,likes 全部标 unknown 并 log.warn 一声, 不静默降级。 实测(mid=946974):默认 order 首页 10 条 9 条拿到真实点赞(171242 / 176864 …), 未覆盖的那条是付费课程;--page 2 三条全覆盖。
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.
动机
B 站列表类命令的底层响应里本来就带着时长 / 播放量 / 精确发布秒 / 封面 / 作者 mid + 头像,只是没进 columns,下游只能在召回后再打一轮请求补抓。这批改动零新请求、零新登录态,老列的名字和格式全部保持不变;新列一律给数字 / unix 秒,展示串保留原列。
顺带修一个真实 bug:
user-videos的likes一直恒为 0。改动
commit 1 — feed / search / user-videos / video 透出元数据
feed:pub_ts/mid/face/bvid/cover/duration/duration_sec/plays/danmaku/desc/only_fansuser-videos:created_ts/duration/duration_sec/comments/danmaku/bvid/cover/desc/is_paysearch:mid/plays/likes/danmaku/favorites/duration/duration_sec/pubdate_ts/cover/face/desc(score仍等于 play;user 分支补mid/face)video:mid/face/pubdate_ts/duration_secutils新增parseDurationText("24:34"→1474)、parseCountText("1.2万"→12000)、httpsUrl(http://与协议相对地址升 https)feed的pub_ts实测返回字符串,统一转成数字commit 2 — user-videos 的 likes 不再恒为 0
arc/search的vlist[]根本没有like字段(实测恒undefined),likes: item.like ?? 0让每一条都显示 0 —— 看着像"零赞",其实是"没这个数据",下游没法区分/x/v2/medialist/resource/list)取cnt_info.thumb_up:整页一次请求补齐,不是每条一次,按 aid join。窗口取本页条数的两倍多一点(上限 50),避免 medialist 漏掉的稿件(付费课程、充电专属之类)把后面几条挤出窗口likes_known列:medialist 只按发布时间倒序列稿件,--order click / stow时多数行对不上,这些行如实报likes: 0+likes_known: false,不假装是零赞log.warn一声,不静默降级--page 2三条全覆盖验证
clis/bilibili152 个用例通过(feed / search / user-videos 新增测试文件,utils / video 补断言)cli-manifest.json已重新生成,check:silent-column-drop无新增违规docs/adapters/browser/bilibili.md补充说明