fix
This commit is contained in:
1 parent
f6f6b41c5f
commit
4667afe295
3 files changed
+67
-39
No files matched your search
@@ -66,8 +66,7 @@ class baseComic:
|
||||
读取某章节下所有图片
|
||||
'''
|
||||
@classmethod
|
||||
def comicChapter(cls,chapter_url,scramble=None,sleep=None):
|
||||
is_next = True
|
||||
def comicChapter(cls,chapter_url,scramble=None,sleep=None,is_next=True):
|
||||
try:
|
||||
is_next = cls.Onechapter(chapter_url,scramble)
|
||||
#进入下个阶段
|
||||
@@ -78,7 +77,7 @@ class baseComic:
|
||||
except Exception as e: is_next = ntfy.sendMsg(f"{ci.getComicName()} 下载出错了",error=e)
|
||||
ntfy.sendMsg(f"预计总章节大小:{cls.count_chapter + 1} / "+ str(ci.getLenChapters()))
|
||||
ci.setChapterIndex(cls.count_chapter + 1)
|
||||
if sleep != None and is_next == True: ntfy.sendMsg(f"{sleep} 秒后开始下载下一个章节",sleep=sleep)
|
||||
if sleep != None and is_next: ntfy.sendMsg(f"{sleep} 秒后开始下载下一个章节",sleep=sleep)
|
||||
|
||||
|
||||
@classmethod
|
||||
@@ -120,31 +119,20 @@ class baseComic:
|
||||
cbz_path = ci.getNewCBZComicChapter()+".CBZ"
|
||||
#更新Icon
|
||||
ci.getNewIconComicChapter()
|
||||
if os.path.exists(cbz_path):
|
||||
if CBZUtils.PackCBZAndequZipLength:
|
||||
ntfy.sendMsg(f"{book_name} {chapter_name} 数据完整,已跳过")
|
||||
ci.nextDoneSave(list_img)
|
||||
is_next = False
|
||||
else:
|
||||
ntfy.sendMsg(f"{book_name} {chapter_name} 数据不完整,尝试删除配置CBZ文件后重试")
|
||||
try:
|
||||
if os.path.getsize(cbz_path) < 300000: fileUtils.remove(cbz_path)
|
||||
else: is_next = False
|
||||
except:
|
||||
ntfy(f"删除失败 {cbz_path}")
|
||||
if os.path.exists(cbz_path): CBZUtils.verCBZComic(cbz_path)
|
||||
if is_next:
|
||||
if not os.path.exists(ci.getPathComicInfoXML()):
|
||||
#print("不存在ComicInfo.xml 生成中...")
|
||||
ci.setPages(files_name)
|
||||
ci.writeComicInfoXML(chapter_name)
|
||||
ntfy.sendMsg(f"{book_name} {chapter_name} 下载中")
|
||||
is_next = verUtils.verNextCBZ(list_img)
|
||||
is_unzip = verUtils.existsUnzipCBZ(files_name)
|
||||
is_next = CBZUtils.nextCBZ(list_img)
|
||||
is_unzip = CBZUtils.existsUnzipCBZ(files_name)
|
||||
repeat = 1
|
||||
while not 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)
|
||||
is_next = len(",".join(os.listdir(ci.getDirComicChapter())).split(".jpg"))-1 == len(list_img)
|
||||
if not is_next:
|
||||
if is_next:
|
||||
sleep_time = 3+int(repeat)*2
|
||||
time.sleep(sleep_time)
|
||||
ntfy.sendMsg(f"下载数据(不完整,{sleep_time}秒钟后尝试第{repeat}次")
|
||||
|
||||
Reference in new issue
Block a user