🐛 fix: ensure all extra data saved before cleanup (#470)

This commit is contained in:
Nyakku Shigure 2025-03-16 15:34:56 +08:00 committed by GitHub
parent dbc8d5a1e6
commit bcfb4f3535
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -382,6 +382,10 @@ async def start_downloader(
cover_save_path.write_bytes(cover_data)
Logger.custom("封面已生成", badge=Badge("封面", fore="black", back="cyan"))
# 保存章节信息
if chapter_info_data:
write_chapter_info(filename, chapter_info_data, chapter_info_path)
if output_path.exists():
if not options["overwrite"]:
Logger.info(f"文件 {filename} 已存在")
@ -407,10 +411,6 @@ async def start_downloader(
video = video if will_download_video else None
audio = audio if will_download_audio else None
# 保存章节信息
if chapter_info_data:
write_chapter_info(filename, chapter_info_data, chapter_info_path)
# 下载视频 / 音频
await download_video_and_audio(ctx, client, video, video_path, audio, audio_path, options)