fix
This commit is contained in:
1 parent
3c8d44f909
commit
f6f6b41c5f
2 files changed
+4
-34
No files matched your search
@@ -23,7 +23,7 @@ class baseComic:
|
|||||||
if ci.getIsComicNameSkips(book_name): return None
|
if ci.getIsComicNameSkips(book_name): return None
|
||||||
if not os.path.exists(ci.getDirConfComic()): ntfy.sendMsg(f"{random.randint(5,20)}秒后开始下载 漫画:{book_name}")
|
if not os.path.exists(ci.getDirConfComic()): ntfy.sendMsg(f"{random.randint(5,20)}秒后开始下载 漫画:{book_name}")
|
||||||
else: ntfy.sendMsg(f"已存在 漫画:{book_name}")
|
else: ntfy.sendMsg(f"已存在 漫画:{book_name}")
|
||||||
if ci.isUpdateComic(): return comic_href
|
if not ci.isUpdateComic(): return comic_href
|
||||||
else:
|
else:
|
||||||
ntfy.sendMsg(f"{book_name} 已是最新")
|
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)
|
chapters = htmlUtils.xpathData('//div[contains(@class,"bookid_chapterBox")]//div[contains(@class,"bookid_chapter")]/a/text()',url=comic_href,update=False)
|
||||||
|
|||||||
@@ -420,44 +420,14 @@ class comicInfo():
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def updateComicDate(cls,date=None):
|
def updateComicDate(cls,date=None):
|
||||||
data = {}
|
|
||||||
update_at = cls.str_update_at
|
update_at = cls.str_update_at
|
||||||
if date != None:
|
if date != None:
|
||||||
update_at = date
|
update_at = date
|
||||||
comic_name = cls.str_comic_name
|
dbUtils.setComic(cls.str_comic_name, update_at, "update")
|
||||||
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()
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def isUpdateComic(cls):
|
def isUpdateComic(cls):
|
||||||
is_update = True
|
return dbUtils.query(cls.str_comic_name, cls.str_update_at,"update")
|
||||||
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
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def comicChapterDownload(cls,imgs,names):
|
def comicChapterDownload(cls,imgs,names):
|
||||||
|
|||||||
Reference in new issue
Block a user