update new Rouman5
This commit is contained in:
1 parent
6638254416
commit
5f5b6cb6ec
10 files changed
+142
-169
No files matched your search
@@ -3,6 +3,7 @@ from xml.dom import minidom
|
||||
from typing import List
|
||||
import json,os
|
||||
from lxml import etree
|
||||
from Comics.settings import COMIC_INFO_XML_FILE,COMIC_INFO_XSD_FILE,OUTPUT_DIR,PROJECT_KEY
|
||||
|
||||
# Define the ComicInfo and ComicPageInfo classes
|
||||
class ComicInfo:
|
||||
@@ -94,7 +95,7 @@ class ComicInfoXml:
|
||||
if remove:
|
||||
os.remove(xml_file)
|
||||
|
||||
def parse_comicinfo(self, comic: ComicInfo, save_dir=None, xml_filename="ComicInfo.xml", xsd_filename="ComicInfo_2.1.xsd"):
|
||||
def parse_comicinfo(self, comic: ComicInfo, save_dir=None, xml_filename="ComicInfo.xml", xsd_filename="ComicInfo.xsd"):
|
||||
"""_summary_
|
||||
|
||||
Args:
|
||||
@@ -143,7 +144,7 @@ class ComicInfoXml:
|
||||
#xml_data = json_to_xml_with_declaration(json_data)
|
||||
#print(xml_data)
|
||||
|
||||
def scrapy_xml_by_json(self, json_data, save_dir=None):
|
||||
def scrapy_xml_by_json(self, json_data, save_dir=None, xsd_file=COMIC_INFO_XSD_FILE):
|
||||
comic = ComicInfo()
|
||||
comic.Title = json_data.get("chapter", "")
|
||||
comic.Series = json_data.get("name", "")
|
||||
@@ -163,5 +164,5 @@ class ComicInfoXml:
|
||||
page.Image = image_name.split(".")[0].split("_")[-1]
|
||||
pages.append(page.Image)
|
||||
comic.Pages.append(page)
|
||||
self.parse_comicinfo(comic, save_dir=save_dir)
|
||||
self.parse_comicinfo(comic, save_dir=save_dir, xsd_filename=xsd_file)
|
||||
return pages
|
||||
Reference in new issue
Block a user