This commit is contained in:
caiwx86 2023-02-14 04:42:54 +08:00
parent 3c8d44f909
commit f6f6b41c5f
2 changed files with 4 additions and 34 deletions

View File

@ -23,7 +23,7 @@ class baseComic:
if ci.getIsComicNameSkips(book_name): return None
if not os.path.exists(ci.getDirConfComic()): ntfy.sendMsg(f"{random.randint(5,20)}秒后开始下载 漫画:{book_name}")
else: ntfy.sendMsg(f"已存在 漫画:{book_name}")
if ci.isUpdateComic(): return comic_href
if not ci.isUpdateComic(): 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)

View File

@ -420,44 +420,14 @@ class comicInfo():
@classmethod
def updateComicDate(cls,date=None):
data = {}
update_at = cls.str_update_at
if date != None:
update_at = date
comic_name = cls.str_comic_name
update_path = pathStr.base_comic_update()
update_dir = os.path.dirname(update_path)
if not os.path.exists(update_dir):
os.makedirs(update_dir)
if os.path.exists(update_path):
with open(update_path,"r") as fs:
data = json.loads(fs.read())
fs.close()
data[comic_name] = update_at
with open(update_path,"w") as fs:
fs.write(json.dumps(data))
fs.close()
dbUtils.setComic(cls.str_comic_name, update_at, "update")
@classmethod
def isUpdateComic(cls):
is_update = True
data = {}
c_update_at = cls.str_update_at
comic_name = cls.str_comic_name
update_path = pathStr.base_comic_update()
update_dir = os.path.dirname(update_path)
if not os.path.exists(update_dir):
os.makedirs(update_dir)
try:
with open(update_path,"r") as fs:
data = json.loads(fs.read())
fs.close()
except:
data = {}
comic_update = data.get(comic_name)
if comic_name != None and comic_update == c_update_at:
is_update = False
return is_update
return dbUtils.query(cls.str_comic_name, cls.str_update_at,"update")
@classmethod
def comicChapterDownload(cls,imgs,names):