23 lines
968 B
Python
23 lines
968 B
Python
from common.ComicInfo import ComicInfoUtils as ciUtils
|
|
from common.ComicInfo import ComicInfo as ci
|
|
from common.Comic import Comic
|
|
from utils.NetUtils import htmlUtils
|
|
|
|
class DomainDown:
|
|
@classmethod
|
|
def comicChapterDownload(cls,chapter_url):
|
|
imgs_url =htmlUtils.xpathData("//div[@class='gb-inside-container']/img/@data-src",url=chapter_url,update=True)
|
|
# pages_imgs =htmlUtils.xpathData("//div[@class='center scramble-page']/@id",url=chapter_url)
|
|
#print("img_list:",len(img_list))
|
|
list_img = []
|
|
list_file_name = []
|
|
count = 1
|
|
for i in imgs_url:
|
|
img_su = str(i).split('.')[-1]
|
|
count_image = "{:0>3d}".format(count)
|
|
list_file_name.append(count_image+"."+img_su)
|
|
list_img.append(count_image)
|
|
count += 1
|
|
ci.setPages(list_img)
|
|
ci.writeComicInfoXML(Comic.getChapterName())
|
|
ciUtils.comicChapterDownload(imgs_url,list_file_name) |