fix(transcriber): kuaishou ASR API 永久下线,改为清晰错误提示 - #448
Open
EricWang1358 wants to merge 1 commit into
Open
Conversation
快手官方已永久关闭 ai.kuaishou.com/api/effects/subtitle_generate 接口,所有调用都返回 code=501 msg='效果subtitle_generate禁用'。 旧实现默默把 501 错误冒泡出去,前端只能展示'快手 API 返回错误: 未知错误', 用户无法定位到是该接口本身已下线,还会浪费上传带宽。 本次改动: - KuaishouTranscriber._submit 直接在入口处 raise RuntimeError, 提示用户去设置里把转写引擎切到 bcut 或 Faster Whisper - 移除 _submit 里现已无用的 try 块 - 新增 test_kuaishou_disabled.py 覆盖短路行为 + 不发网络请求 - CHANGELOG 加 [Unreleased] 段
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.
改动概述
ix(transcriber): 快手 ASR 接口已永久下线(返回 code=501, msg=效果subtitle_generate禁用),本次改动让 KuaishouTranscriber._submit 在入口直接抛带操作指引的 RuntimeError,提示用户切换到 bcut 或 Faster Whisper。
为什么
旧实现会把一条 501 错误冒泡出去,前端只能展示「快手 API 返回错误: 未知错误」之类的笼统提示,用户无从得知是该接口本身已下线;且仍会浪费一次完整上传(若是大音频文件,网络与磁盘 IO 都白做)。
用户场景:用户在「设置 → 音频转写配置」中误选「快手 ASR」后,提交笔记生成会跑完整个下载 / 上传链路,最后才在结果页看到「未知错误」。
做了什么
aise RuntimeError(...),并清理掉随之变得不可达的旧 try 块。
equests.post 不再被调用。
测试方式
回归风险
Checklist