This commit is contained in:
cwx committed 2023-02-14 06:41:04 +08:00
1 parent 226ca3ef33
commit 5ccbacbc70
2 files changed
+5 -4

No files matched your search

+2
View File
@@ -59,9 +59,11 @@ class CBZUtils:
os.remove(file) os.remove(file)
except: except:
print(f"删除 {file} 发生错误,已跳过") print(f"删除 {file} 发生错误,已跳过")
return False
cls.zip_compression(comicInfo.getDirComicChapter(), cls.getCBZ_Path()) cls.zip_compression(comicInfo.getDirComicChapter(), cls.getCBZ_Path())
time.sleep(0.1) time.sleep(0.1)
fileUtils.remove(comicInfo.getDirComic()) fileUtils.remove(comicInfo.getDirComic())
return True
@classmethod @classmethod
def replaceZip(cls,filepath,unpack_dir=None): def replaceZip(cls,filepath,unpack_dir=None):
+3 -4
View File
@@ -68,8 +68,7 @@ class baseComic:
读取某章节下所有图片 读取某章节下所有图片
''' '''
@classmethod @classmethod
def comicChapter(cls,chapter_url,scramble=None,sleep=None): def comicChapter(cls,chapter_url,scramble=None,sleep=None,is_next=True):
is_next = True
try: try:
is_next = cls.Onechapter(chapter_url,scramble) is_next = cls.Onechapter(chapter_url,scramble)
#进入下个阶段 #进入下个阶段
@@ -134,8 +133,8 @@ class baseComic:
repeat = 1 repeat = 1
while is_next and repeat <= 2 and not is_unzip: while is_next and repeat <= 2 and not is_unzip:
download_images(list_img,ci.getDirComicChapter(), files_name=files_name,concurrency=10,timeout=60) download_images(list_img,ci.getDirComicChapter(), files_name=files_name,concurrency=10,timeout=60)
is_next = len(",".join(os.listdir(ci.getDirComicChapter())).split(".jpg"))-1 == len(list_img) equ_next = len(",".join(os.listdir(ci.getDirComicChapter())).split(".jpg"))-1 == len(list_img)
if is_next: if not equ_next:
sleep_time = 3+int(repeat)*2 sleep_time = 3+int(repeat)*2
time.sleep(sleep_time) time.sleep(sleep_time)
ntfy.sendMsg(f"下载数据(不完整,{sleep_time}秒钟后尝试第{repeat}次") ntfy.sendMsg(f"下载数据(不完整,{sleep_time}秒钟后尝试第{repeat}次")