Skip to content

feat: 添加下载 AI 原声翻译音轨功能 - #5660

Merged
the1812 merged 3 commits into
the1812:preview-featuresfrom
EricZhou05:feat/ai-audio-tracks
Jul 29, 2026
Merged

feat: 添加下载 AI 原声翻译音轨功能#5660
the1812 merged 3 commits into
the1812:preview-featuresfrom
EricZhou05:feat/ai-audio-tracks

Conversation

@EricZhou05

@EricZhou05 EricZhou05 commented Jul 13, 2026

Copy link
Copy Markdown

感谢开发者大大这么久的更新~插件超级好用的一直在用!现在顺便给视频下载功能加上了“音轨选择”的支持,现在可以下载「AI 原声翻译」的音轨了。

平时碰到带多音轨(比如 AI 翻译)的视频,默认只能下到原声,这个改动主要是为了把其他音轨也暴露出来供大家选择。

改动

  • 底层 API 扩展:更新了视频下载的数据结构,在 DownloadVideoInfo 和 DASH 接口中增加了对 audioTracks 的解析。请求时如果有指定音轨,会带上 cur_language 参数。
  • UI 适配:在视频下载界面的画质下方加了个音轨选项卡。如果接口返回了多音轨,下拉框就会显示出来,默认会选中「原声」。
  • 组件优化:稍微改了下基础组件 VDropdown.vue,给它加了个 valueKey 的 props。主要是为了避免下拉框里的对象引用变化时触发一些不必要的冗余 change 事件(也会导致重复请求)。

自查

  • 目标分支是 preview-features
  • 没有包含 dist/ 或其他编译生成的文件
  • 本地已通过 pnpm run type
  • 本地已通过 pnpm run lint-check
  • 未修改或提交 doc/features/ 下的自动生成文档

在本地环境测试过下载带 AI 翻译的视频,音轨能正常切换并下载成功,麻烦各位大佬帮忙 review 下,看看有没有什么需要优化的地方。

PixPin_2026-07-13_23-26-26

Copilot AI review requested due to automatic review settings July 13, 2026 15:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

此 PR 为视频下载组件增加“音轨选择”能力,使下载 DASH 视频时可以选择包括「AI 原声翻译」在内的不同音轨语言;同时扩展了下载信息结构,并对下拉组件做了小幅增强以避免对象引用变化导致的冗余 change 触发。

Changes:

  • 扩展下载数据结构:为 DownloadVideoInputItem 增加 audioTrack,为 DownloadVideoInfo 增加 audioTracks
  • DASH 拉流参数与解析增强:请求支持携带 cur_language,并从返回数据解析音轨列表。
  • 下载面板 UI 增加音轨下拉框,并通过 VDropdown.valueKey 降低重复触发变更事件带来的重复请求风险。

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/ui/VDropdown.vue 新增 valueKey props,用于在选择时按“键值”而非对象引用判断是否变更,减少冗余 change 事件。
registry/lib/components/video/download/types.ts 在下载输入与下载信息中补充音轨相关类型与字段,供 API/UI 串联使用。
registry/lib/components/video/download/DownloadVideo.vue 下载面板新增音轨选择下拉框,并把选中的音轨写入测试请求与实际下载请求。
registry/lib/components/video/download/apis/dash.ts DASH 请求在指定音轨时附带 cur_language,并解析返回的音轨语言列表到 DownloadVideoInfo.audioTracks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread registry/lib/components/video/download/DownloadVideo.vue Outdated
@the1812

the1812 commented Jul 18, 2026

Copy link
Copy Markdown
Owner

关于 VDropdown 的部分,是不是复用一下 keyMapper 判断是否触发 change 就行了,加 valueKey 看起来有点重复

Comment thread registry/lib/components/video/download/types.ts Outdated
Comment thread registry/lib/components/video/download/DownloadVideo.vue Outdated
- 在视频下载功能中支持选择音轨
- 更新相关数据结构以包含音轨信息
- 修改界面以显示可用音轨选项
- 将音轨相关字段名称从 audioTracks 修改为 audioLanguages
- 更新 DownloadVideoAudioTrack 接口为 DownloadVideoAudioLanguage
- 调整相关逻辑以适应新的字段名称和类型

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread registry/lib/components/video/download/apis/dash.ts
Comment thread registry/lib/components/video/download/apis/dash.ts
@EricZhou05

Copy link
Copy Markdown
Author

感谢审查~
最初 UI 命名为 "AI 原声翻译",是因为个人日常只遇到过 AI 原声翻译这个场景,完全没碰到过 B 站其他的多音轨视频。不过当时底层字段确实是奔着泛化的多音轨去设计的。
现在综合建议,将 UI 彻底泛化为“选择音轨”,并将字段重命名为 audioLanguage,这样可以更加精准表达字段实际传递的是语言代码,也能兼容官方以后拓展的其他多音轨功能。
PS: 如果其他开发者知道哪些特定的番剧/视频带有传统的非 AI 多音轨选项,欢迎提供一下用来做测试~

@EricZhou05
EricZhou05 requested a review from the1812 July 29, 2026 02:24
@the1812
the1812 merged commit eee4471 into the1812:preview-features Jul 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants