This commit is contained in:
caiwx86 2023-03-31 22:25:33 +08:00
parent ea7005356c
commit aec2242852
2 changed files with 4 additions and 5 deletions

View File

@ -14,7 +14,7 @@ class comicEntity:
@classmethod
def downladsComcis(cls,url):
#漫画名
books = cls.booksJson(url)
books = cls.booksJson(url,update=True)
for x in range(0, len(books)):
comicInfo.setComicInfo(comicname=books[x].get("name"),
current_chapter_img=comicInfo.getBaseUrl(url)+"/books/"+books[x].get("id"),

View File

@ -53,9 +53,7 @@ class htmlUtils:
@classmethod
def getHTML(cls, curl,type=None,update=False):
url_text = None
retries = Retry(total=1,
backoff_factor=0.1,
status_forcelist=[ 500, 502, 503, 504 ])
retries = Retry(total=1, backoff_factor=0.1, status_forcelist=[ 500, 502, 503, 504 ])
s = requests.Session()
s.mount('http://', HTTPAdapter(max_retries=retries))
s.mount('https://', HTTPAdapter(max_retries=retries))
@ -101,7 +99,8 @@ class htmlUtils:
return cls.getHTML(url,type="bytes")
@classmethod
def getJSON(cls,url,update=False):
def getJSON(cls,url,update=False,test=True):
json_data = cls.getHTML(url,type="json")
return cls.getHTML(url,type="json")
@classmethod