Skip to content

VideoCaptioner CLI 使用 bing 翻译器时, 强制要求填写 LLM api key #1113

@lawrenceching

Description

@lawrenceching

问题描述 | Problem Description

使用 CLI 执行字幕翻译操作
使用免费的 bing 翻译器 (而不是 LLM 翻译器)
参数校验要求输入 LLM API Key

填入任意 --api-key , 翻译能正常工作
这应该只是一个命令行参数校验的BUG

$ /c/Users/xxx/AppData/Local/Programs/Python/Python310/Scripts/videocaptioner.exe subtitle 'xxx.srt' --translator bing
✗ Error: LLM API key is not configured

  Fix with any of:
    1. videocaptioner config set llm.api_key <value>
    2. export VIDEOCAPTIONER_LLM_API_KEY=<value>
    3. videocaptioner ... --api-key <value>

$ /c/Users/xxx/AppData/Local/Programs/Python/Python310/Scripts/videocaptioner.exe --version
videocaptioner 1.4.1

# 随便指定一个 api key
$ /c/Users/xxx/AppData/Local/Programs/Python/Python310/Scripts/videocaptioner.exe subtitle 'xxx' --translator bing --api-key '123'
⠋ Processing subtitles[+]正在优化字幕:1 - 10
[+]正在优化字幕:11 - 20
[+]正在优化字幕:21 - 30
[+]正在优化字幕:31 - 40
⠸ Optimizing subtitles... [20%]2026-05-12 16:59:57 - subtitle_optimizer - ERROR - 优化失败:Request timed out.
[+]正在优化字幕:41 - 50

日志信息(可选)| Logs (Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions