mirror of https://github.com/yutto-dev/yutto
🐛 fix: ensure all extra data saved before cleanup (#470)
This commit is contained in:
parent
dbc8d5a1e6
commit
bcfb4f3535
|
@ -382,6 +382,10 @@ async def start_downloader(
|
||||||
cover_save_path.write_bytes(cover_data)
|
cover_save_path.write_bytes(cover_data)
|
||||||
Logger.custom("封面已生成", badge=Badge("封面", fore="black", back="cyan"))
|
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 output_path.exists():
|
||||||
if not options["overwrite"]:
|
if not options["overwrite"]:
|
||||||
Logger.info(f"文件 {filename} 已存在")
|
Logger.info(f"文件 {filename} 已存在")
|
||||||
|
@ -407,10 +411,6 @@ async def start_downloader(
|
||||||
video = video if will_download_video else None
|
video = video if will_download_video else None
|
||||||
audio = audio if will_download_audio 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)
|
await download_video_and_audio(ctx, client, video, video_path, audio, audio_path, options)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue