This commit is contained in:
cwx
2023-01-15 19:44:49 +08:00
parent 537b4d8827
commit d05897e11f
4 changed files with 58 additions and 13 deletions
+11 -1
View File
@@ -29,6 +29,13 @@ class baseComic:
return comic_href
else:
ntfy.sendMsg(f"{book_name} 已是最新")
chapters = htmlUtils.xpathData('//div[contains(@class,"bookid_chapterBox")]//div[contains(@class,"bookid_chapter")]/a/text()',url=comic_href,update=False)
chapter_index = 1
for chapter in chapters:
comicInfo.setChapterIndex(chapter_index)
comicInfo.setChapterName(chapter)
comicInfo.getNewCBZComicChapter()
chapter_index = chapter_index + 1
return None
#print(books)
@@ -55,6 +62,7 @@ class baseComic:
cls.count_chapter = 0
for href in chapter_href:
chapter = chapters[cls.count_chapter]
comicInfo.setChapterIndex(cls.count_chapter+1)
comicInfo.setChapterName(chapter)
if not comicInfo.nextExistsGetPath("done_"):
cls.comicChapter(href,scramble=True,sleep=random.randint(5,15))
@@ -98,6 +106,7 @@ class baseComic:
# ntfy.sendMsg(f"{comicInfo.getComicName()} 下载出错了")
# is_next = False
ntfy.sendMsg(f"预计总章节大小:{cls.count_chapter + 1} / "+ str(comicInfo.getLenChapters()))
comicInfo.setChapterIndex(cls.count_chapter + 1)
if sleep != None and is_next == True:
ntfy.sendMsg(f"{sleep} 秒后开始下载下一个章节")
time.sleep(sleep)
@@ -139,7 +148,8 @@ class baseComic:
#保存图像
comicInfo.nextSaveInfoChapter(chapter_name, list_img)
#验证数据是已存在且是否完整
cbz_path = comicInfo.getDirCBZComicChapter()+".CBZ"
#cbz_path = comicInfo.getDirCBZComicChapter()+".CBZ"
cbz_path = comicInfo.getNewCBZComicChapter()+".CBZ"
is_next = True
if os.path.exists(cbz_path):
try: