This commit is contained in:
cwx
2022-12-13 00:24:45 +08:00
parent 3d00520c14
commit 99b2dabd1d
6 changed files with 25 additions and 19 deletions
+6 -5
View File
@@ -5,6 +5,7 @@ from utils.ImageUtils import imageUtils
from utils.comic.ComicInfo import comicInfo
from utils.CBZUtils import CBZUtils
from utils.downloader import download_images
from utils.Ntfy import ntfy
class comicEntity:
@@ -33,7 +34,7 @@ class comicEntity:
comicInfo.setComicName(book_name)
#dirConfComic = comicInfo.getDirConfComic()
#if not os.path.exists(dirConfComic):
netUtils.sendMsg(f"{random_int}秒后开始下载 漫画:{book_name}")
ntfy.sendMsg(f"{random_int}秒后开始下载 漫画:{book_name}")
time.sleep(random_int)
cls.oneComic(comicHref, random.uniform(0,3))
@@ -106,14 +107,14 @@ class comicEntity:
#完成删除原文件
remove_path = comicInfo.getDirComicChapter()
shutil.rmtree(remove_path)
netUtils.sendMsg(f"文件已删除: {remove_path}")
ntfy.sendMsg(f"文件已删除: {remove_path}")
except:
dirComicChapter = comicInfo.getDirComicChapter
if not dirComicChapter == None and os.path.exists(dirComicChapter):
shutil.rmtree(dirComicChapter)
cls.comicChapter(chapter_url,scramble,sleep)
if not sleep == None:
netUtils.sendMsg(f"{sleep} 秒后开始下载下一个章节")
ntfy.sendMsg(f"{sleep} 秒后开始下载下一个章节")
time.sleep(sleep)
@classmethod
@@ -149,7 +150,7 @@ class comicEntity:
description = x.get("description")
images = x.get("images")
chapterAPIPath = x.get("chapterAPIPath")
netUtils.sendMsg(f"{bookName} {chapterName} 下载中")
ntfy.sendMsg(f"{bookName} {chapterName} 下载中")
comicInfo.setComicName(bookName)
comicInfo.setChapterName(chapterName)
comicInfo.setDep(description)
@@ -166,7 +167,7 @@ class comicEntity:
chapterName = data.get("name")
images = data.get("images")
if images == None:
netUtils.sendMsg(f"未获取到章节图像 comic_name={bookName} chapter={chapterName}")
ntfy.sendMsg(f"未获取到章节图像 comic_name={bookName} chapter={chapterName}")
totalChapter = x.get("totalChapter")
tags = x.get("tags")
x = tags