fix(asr): use content_dir for subtitle output instead of video_path
PR Test / lint (pull_request) Successful in 2s
PR Test / lint (pull_request) Successful in 2s
- Add content_dir field to ASRInput schema
- Pass content_dir from pipeline when creating ASRInput
- Modify _try_official_subtitle to use content_dir for output
- Modify _run_whisper_basic to use content_dir for output
- Add validation for empty video_path in Whisper fallback
Root cause: DownloadProcessor sets content_file="" for video types,
causing Path("").parent to resolve to current directory instead of
content directory. Subtitle files were written to wrong location.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -198,11 +198,13 @@ class ASRInput(StepInput):
|
||||
继承 StepInput 的基础字段,添加视频路径和内容类型。
|
||||
|
||||
Attributes:
|
||||
video_path: 视频文件路径
|
||||
video_path: 视频文件路径(可能为空,用于 Whisper 降级)
|
||||
content_type: 内容类型,默认为 'video'
|
||||
content_dir: 内容目录路径,用于输出字幕文件
|
||||
"""
|
||||
video_path: str = Field(..., description="视频文件路径")
|
||||
video_path: str = Field(default="", description="视频文件路径(可能为空)")
|
||||
content_type: str = Field(default="video", description="内容类型")
|
||||
content_dir: str = Field(..., description="内容目录路径")
|
||||
|
||||
|
||||
class ASROutput(StepOutput):
|
||||
|
||||
Reference in New Issue
Block a user