跳过本地已完整下载的视频,避免为其创建耗时的 async task

This commit is contained in:
yzqzss 2023-08-04 19:37:10 +08:00
parent 07060e7226
commit 595214e37b

View File

@ -151,6 +151,13 @@ def _main():
print(f'IA 上已存在 {remote_identifier} ,跳过')
continue
upper_part = human_readable_upper_part_map(string=bvid, backward=True)
videos_basepath: Path = config.storage_home_dir / 'videos' / f'{bvid}-{upper_part}'
if os.path.exists(videos_basepath / '_all_downloaded.mark'):
print(f'{bvid} 所有分p都已下载过了')
continue
if len(tasks) >= config.video_concurrency:
loop.run_until_complete(asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED))
tasks_check()