fix
This commit is contained in:
parent
a756a1d1b8
commit
8deb799280
@ -18,9 +18,6 @@ class comicCommon:
|
||||
x = cls.baseComicData(chapter_url,update=True)
|
||||
book_name = x.get("bookName")
|
||||
chapter_name = x.get("chapterName")
|
||||
#fileUtils.saveConfComicChapterInfo(chapterName,x,bookName)
|
||||
#if comicInfo.nextExistsGetPath("info_"):
|
||||
# print(f"{bookName} {chapterName} info文件已存在跳过")
|
||||
alias = x.get("alias")
|
||||
description = x.get("description")
|
||||
images = x.get("images")
|
||||
@ -31,8 +28,7 @@ class comicCommon:
|
||||
|
||||
if chapter_api_path != None:
|
||||
chapter_api_path = str(chapter_api_path).encode('utf-8').decode('unicode_escape')
|
||||
base_url = comicInfo.getBaseUrl(chapter_url)
|
||||
chapter_api_url = base_url+chapter_api_path
|
||||
chapter_api_url = comicInfo.getBaseUrl(chapter_url)+chapter_api_path
|
||||
ntfy.sendMsg(f"chapterApiUrl= {chapter_api_url}",alert=False)
|
||||
data = htmlUtils.getJSON(chapter_api_url,update=True)
|
||||
if data != None:
|
||||
|
||||
2
main.py
2
main.py
@ -7,7 +7,7 @@ def rouman():
|
||||
pathStr.setComicMainAndPath(pathStr.comic_rm)
|
||||
skip.roumanskip()
|
||||
for x in range(0,52):
|
||||
roumanEntity.downladsComcis("https://rm01.xyz/books?&page="+str(x))
|
||||
roumanEntity.downladsComcis("https://rm01.xyz/books?&page="+str(x))
|
||||
|
||||
def baozi():
|
||||
pathStr.setComicMainAndPath(pathStr.comic_bz)
|
||||
|
||||
@ -157,4 +157,5 @@ class CBZUtils:
|
||||
|
||||
@classmethod
|
||||
def nextCBZ(cls,list_img=None):
|
||||
if list_img == None: list_img = comicInfo.getChapterImgs()
|
||||
return not cls.verCBZComic(list_img=list_img)
|
||||
@ -108,30 +108,21 @@ class baseComic:
|
||||
if comic_main == None: print("comic_main为空,退出中...") & exit()
|
||||
|
||||
(list_img,files_name,chapter_name,book_name) = [ci.getChapterListImg(),ci.getChapterFilesName(),ci.getChapter(),ci.getComicName()]
|
||||
ci.setChapterImgs(list_img)
|
||||
#保存信息
|
||||
ci.nextSaveInfoChapter(chapter_name, list_img)
|
||||
ci.nextSaveInfoChapter(chapter_name,list_img)
|
||||
#验证数据是已存在且是否完整
|
||||
#cbz_path = ci.getDirCBZComicChapter()+".CBZ"
|
||||
cbz_file = ci.getNewFileCBZComicChapter()
|
||||
#更新Icon
|
||||
ci.getNewIconComicChapter()
|
||||
#检验CBZ文件
|
||||
CBZUtils.verCBZComic(cbz_file)
|
||||
|
||||
if is_next and fu.notExists(ci.getPathComicInfoXML()):
|
||||
#print("不存在ComicInfo.xml 生成中...")
|
||||
ci.setPages(files_name)
|
||||
ci.writeComicInfoXML(chapter_name)
|
||||
is_next = CBZUtils.nextCBZ(list_img)
|
||||
#不存在ComicInfo.xml则生成
|
||||
if is_next and fu.notExists(ci.getPathComicInfoXML()): ci.writeComicInfoXML(chapter_name)
|
||||
repeat = 1
|
||||
while is_next and repeat <= 10 and not CBZUtils.updateOldCBZ(files_name):
|
||||
while CBZUtils.nextCBZ() and repeat <= 10 and not CBZUtils.updateOldCBZ(files_name):
|
||||
ntfy.sendMsg(f"{book_name} {chapter_name} 下载中")
|
||||
download_images(list_img,ci.getDirComicChapter(), files_name=files_name,concurrency=None,timeout=8)
|
||||
equ_next = len(",".join(os.listdir(ci.getDirComicChapter())).split(".jpg"))-1 == len(list_img)
|
||||
if not equ_next:
|
||||
sleep_time = int(repeat)*2
|
||||
time.sleep(sleep_time)
|
||||
ntfy.sendMsg(f"下载数据(不完整,{sleep_time}秒钟后尝试第{repeat}次")
|
||||
if not equ_next: ntfy.sendMsg(msg=f"下载数据(不完整,{int(repeat*2)}秒钟后尝试第{repeat}次",sleep=int(repeat*2))
|
||||
repeat += 1
|
||||
return is_next
|
||||
@ -414,7 +414,8 @@ class comicInfo():
|
||||
return save_path
|
||||
|
||||
@classmethod
|
||||
def nextSaveInfoChapter(cls,chapter,data):
|
||||
def nextSaveInfoChapter(cls,chapter,data=None):
|
||||
if data == None: data = cls.getChapterImgs()
|
||||
if cls.str_chapter != chapter:
|
||||
print(f"chapter {cls.str_chapter} 与 {chapter} 不一致,已自动跳过")
|
||||
cls.setProgress(cls.PROGRESS_INFO)
|
||||
@ -468,7 +469,9 @@ class comicInfo():
|
||||
|
||||
@classmethod
|
||||
def comicChapterDownload(cls,imgs,names):
|
||||
cls.setChapterImgs(imgs)
|
||||
cls.setChapterListImg(imgs)
|
||||
cls.setPages(names)
|
||||
cls.setChapterFilesName(names)
|
||||
|
||||
@classmethod
|
||||
|
||||
Loading…
Reference in New Issue
Block a user