This commit is contained in:
caiwx86 2023-04-05 20:21:51 +08:00
parent b7b8fb600b
commit b07521e7a7
3 changed files with 7 additions and 4 deletions

View File

@ -67,8 +67,9 @@ class baseComic:
if ciUtils.isProgressDone() and fu.notExists(ComicPath.getNewCBZComicChapter("file")):
ciUtils.setProgressFail()
#不存在完成配置文件 则允许下载
if not ciUtils.isProgressDone():
cls.comicChapters(href,scramble=True,sleep=random.randint(8,20))
if not ciUtils.isProgressDone():
ComicPath.TIME_SLEEP = random.randint(8,20)
cls.comicChapters(href,scramble=True)
cls.count_chapter += 1
#一本漫画下载后等待
#清空文件夹
@ -82,7 +83,7 @@ class baseComic:
读取某章节下所有图片
'''
@classmethod
def comicChapters(cls,chapter_url,scramble=None,sleep=None):
def comicChapters(cls,chapter_url,scramble=None):
is_next = False
#try:
cls.Onechapter(chapter_url,scramble)
@ -94,7 +95,7 @@ class baseComic:
#except Exception as e: is_next = ntfy.sendMsg(f"{ci.getComicName()} 下载出错了",error=e)
ntfy.sendMsg(f"预计总章节大小:{cls.count_chapter + 1} / "+ str(Comic.getLenChapters()))
Comic.setNumber(cls.count_chapter + 1)
if sleep != None and is_next: ntfy.sendMsg(f"{sleep} 秒后开始下载下一个章节",alert=True,sleep=sleep)
if is_next: ntfy.sendMsg(f"{ComicPath.TIME_SLEEP} 秒后开始下载下一个章节",alert=True,sleep=ComicPath.TIME_SLEEP)
#根据章节地址下载全部图片并将文件名scramble开头的图片进行解密
@classmethod

View File

@ -80,6 +80,7 @@ class ComicPath:
PROGRESS_PATH = "progress"
ICONS_PATH = "icons"
COMIC_INFO_XML = "ComicInfo.xml"
TIME_SLEEP = 0
#顶级路径
@classmethod

View File

@ -140,6 +140,7 @@ class CBZUtils:
if ciUtils.isProgressDone():
ntfy.sendMsg(f"该文件已校验成功,跳过中... {path}",alert=True)
ComicPath.TIME_SLEEP = 0.1
return True
if fu.exists(path) and len(cls.zip_info(path)) == len(list_img):
ntfy.sendMsg(f"文件校验成功:{path}",alert=True)