Repository navigation
feat: X(Twitter) resolve 透出全部 mp4 variants(码率升序),供下游 ASR 自选低码率流 - #28
Merged
Merged
Conversation
added 8 commits
September 14, 2026 20:26
Agent-Executor: codex Agent-Model: gpt-5.6-luna Agent-Effort: xhigh Dispatch-Id: dlg-20260914-122425-3250c5 Task-Id: MediaResolverAPI-20260914-06
Agent-Executor: codex Agent-Model: gpt-5.6-luna Agent-Effort: xhigh Dispatch-Id: dlg-20260914-122425-3250c5 Task-Id: MediaResolverAPI-20260914-06
Agent-Executor: codex Agent-Model: gpt-5.6-luna Agent-Effort: xhigh Dispatch-Id: dlg-20260914-122425-3250c5 Task-Id: MediaResolverAPI-20260914-06
Agent-Executor: codex Agent-Model: gpt-5.6-luna Agent-Effort: xhigh Dispatch-Id: dlg-20260914-122425-3250c5 Task-Id: MediaResolverAPI-20260914-06
Agent-Executor: codex Agent-Model: gpt-5.6-luna Agent-Effort: xhigh Dispatch-Id: dlg-20260914-122425-3250c5 Task-Id: MediaResolverAPI-20260914-06
Agent-Executor: codex Agent-Model: gpt-5.6-luna Agent-Effort: xhigh Dispatch-Id: dlg-20260914-122425-3250c5 Task-Id: MediaResolverAPI-20260914-06
Agent-Executor: codex Agent-Model: gpt-5.6-luna Agent-Effort: xhigh Dispatch-Id: dlg-20260914-122425-3250c5 Task-Id: MediaResolverAPI-20260914-06
Agent-Executor: codex Agent-Model: gpt-5.6-luna Agent-Effort: xhigh Dispatch-Id: dlg-20260914-122425-3250c5 Task-Id: MediaResolverAPI-20260914-06
Required Gate v2 — 状态面板当前状态:skipped · 无需动作(主审未跑,绿≠过审)
当前裁决:
Gate 历史(v1;来源为持久化
|
| Run | Attempt | Head | 状态 | 收件人动作 |
|---|---|---|---|---|
| 34844887564 | 1 | 3d2cca7 |
skipped |
无需动作(主审未跑,绿≠过审) |
历史行按 run_id + run_attempt 去重并只增不删;删除本评论后可由 gate_terminal 制品重建。
zj1123581321
marked this pull request as ready for review
September 14, 2026 12:51
⚙️ Review ledger state(机器状态记录,非评审结论)
机器状态明细
完整数据保存在 |
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.
目标
下游 ASR 场景只需要完整音频轨,不想为高分辨率视频付流量。TikHub 的 X 响应里每个 mp4 variant 已带
bitrate、URL 内嵌分辨率,但本服务选完主流通即丢弃。本 PR 把 X(Twitter) video 模式解析到的全部 mp4 variants 以data.variants数组透出(每条含url/bitrate/width/height/quality,码率升序),下游自取第一条即为最省流量的流。改动
VideoInfo新增可选variants字段并进to_dict();cache.py缓存重建透传(直解析与缓存命中两条路径返回一致,有 e2e 回读断言锁定)。twitter.py复用既有 candidates 构造 variants:排除 HLS,全部 mp4 按 bitrate 升序(无效/0 码率排末尾、同码率按短边升序);bitrate非法或 0 →null,quality沿用主字段高度口径f"{height}p"。resolve.py新增VideoVariant响应模型与VideoInfoResponse.variants,逐条经_absolutize_video_url处理;其他平台与 audio 模式恒为null。data.variants字段说明与示例。锁定决策
null(下游 ASR 是唯一消费者,无第二平台需求)。quality参数、download_mode=audio的 Cobalt 路由)零改动。已否决方案
variants为null是可接受的过渡行为。已知语义边界(backlog,不阻塞)
variants会混入同帖多个视频的流,不区分归属;下游按variants[0]选取时可能拿到非主选视频的低码率流。真实触发概率极低,出现时再收敛(按选中视频过滤)。验证
uv run --extra dev python -m pytest tests/ -q→ 413 passed(基线 410 + 新增 3)。tests/test_tikhub_provider_twitter.py新增 3 条同红。Task-Id: MediaResolverAPI-20260914-06