Repository navigation
Conversation
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.
改动概述
修正
BilibiliDownloader.download()不识别skip_download参数的问题,使有字幕时真正跳过音频下载。为什么
note.py在有字幕时会调用BilibiliDownloader.download(skip_download=True),意图仅提取视频元信息。但BilibiliDownloader.download()方法签名不接受该参数,抛出TypeError: ... got an unexpected keyword argument 'skip_download',被外层捕获后回退为完整下载音频,造成不必要的带宽/磁盘开销,也易让用户误以为仍在做语音转写。Fixes 内部行为,无关联 issue。做了什么
仅修改
backend/app/downloaders/bilibili_downloader.py:download()增加skip_download: bool = False参数ydl.extract_info(video_url, download=not skip_download),为 True 时仅提取元信息skip_download=True时audio_path = None,使note.py中if download_result.file_path is None的判断生效(注:
download_subtitles()内既有的'skip_download': True是 yt-dlp 自身参数,未改动。)测试方式
docker restart后 healthy)对
BV1NqWc6gEPh复测:unexpected keyword argument 'skip_download',并完整下载音频download(skip_download=True)不再报错,返回 title/duration 且 file_path=None;note_results 目录下无新增 mp3回归风险
影响面极小:仅
BilibiliDownloader.download()新增可选参数,默认值False与原有行为一致;不改变字幕抓取、转写或笔记生成链路,无需前后端同步部署。Checklist
fix/*(fix/skip-download-when-subtitle)master)type(scope): subject格式(fix(bilibili): ...).env/ 大型二进制