fix rouman

This commit is contained in:
cwx
2023-01-09 19:50:57 +08:00
parent fd694cce81
commit 41a1e81fef
7 changed files with 81 additions and 21 deletions
+9
View File
@@ -12,12 +12,21 @@ from utils.downloader import download_images
from utils.Ntfy import ntfy
from utils.VerUtils import verUtils
from PIL import Image
import get_jm_url
class comicEntity:
count_chapter = 0
aid = None
repeat = 0
@classmethod
def baseReUrl(cls,url):
newurl_list=get_jm_url.app()
if newurl_list:
if re.findall(r'https://(.*?)/\w+/\d+/',url)[0] not in newurl_list:
for newurl in newurl_list:
url = re.sub(re.findall(r'https://(.*?)/\w+/\d+/', url)[0], newurl, url)
return url
@classmethod
def downladsComcis(cls,url):
+7 -5
View File
@@ -152,7 +152,8 @@ class comicEntity:
isScramble = str(img).startswith("scramble=")
if isScramble:
c_path = os.path.join(chapter_dir, img)
imageUtils.getScrambleImage(c_path)
#imageUtils.getScrambleImage(c_path)
imageUtils.encode_scramble_image(c_path)
#进入下一阶段
comicInfo.nextImgToDownloadChapter()
return is_next
@@ -172,10 +173,6 @@ class comicEntity:
comicInfo.setComicName(bookName)
comicInfo.setChapterName(chapterName)
comicInfo.setDep(description)
pathComicInfo = comicInfo.getPathComicInfoXML()
if not os.path.exists(pathComicInfo):
#print("不存在ComicInfo.xml 生成中...")
comicInfo.writeComicInfoXML(chapterName)
if not chapterAPIPath == None:
chapterAPIPath = str(chapterAPIPath).encode('utf-8').decode('unicode_escape')
@@ -237,6 +234,11 @@ class comicEntity:
except:
ntfy(f"删除失败 {cbz_path}")
if is_next:
pathComicInfo = comicInfo.getPathComicInfoXML()
if not os.path.exists(pathComicInfo):
#print("不存在ComicInfo.xml 生成中...")
comicInfo.setPages(list_fileName)
comicInfo.writeComicInfoXML(chapterName)
ntfy.sendMsg(f"{bookName} {chapterName} 下载中")
download_images(list_img,comicInfo.getDirComicChapter(), filesName=list_fileName)
return is_next