fix
This commit is contained in:
parent
244c1b8c39
commit
233e48da27
@ -94,6 +94,7 @@ class FileNaming:
|
||||
if is_update and remove:
|
||||
try:
|
||||
os.remove(path)
|
||||
is_update = False
|
||||
except:
|
||||
raise exit(f"file_update_by_date() {path} 删除失败")
|
||||
return is_update
|
||||
|
||||
@ -198,8 +198,8 @@ class MangaDownloader:
|
||||
|
||||
async def download_image(self, session: aiohttp.ClientSession, url: str, save_path: Path, retries: int = RETRIES, timeout: int = TIMEOUT, use_proxy: bool = RETRY_PROXY) -> bool:
|
||||
"""下载单个图片,增加重试机制、超时等待和文件缓存机制"""
|
||||
FileNaming().file_update_by_date(save_path, remove=True)
|
||||
if os.path.exists(FileNaming.getFileScrambleImageSave(save_path)): # 检查文件是否已存在
|
||||
if FileNaming().file_update_by_date(save_path, remove=True):
|
||||
logger.info(f"文件已存在,跳过下载: {save_path}")
|
||||
return True
|
||||
# 从缓存中获取图片
|
||||
|
||||
Loading…
Reference in New Issue
Block a user