fix
This commit is contained in:
1 parent
ea7005356c
commit
aec2242852
2 files changed
+4
-5
No files matched your search
+1
-1
@@ -14,7 +14,7 @@ class comicEntity:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def downladsComcis(cls,url):
|
def downladsComcis(cls,url):
|
||||||
#漫画名
|
#漫画名
|
||||||
books = cls.booksJson(url)
|
books = cls.booksJson(url,update=True)
|
||||||
for x in range(0, len(books)):
|
for x in range(0, len(books)):
|
||||||
comicInfo.setComicInfo(comicname=books[x].get("name"),
|
comicInfo.setComicInfo(comicname=books[x].get("name"),
|
||||||
current_chapter_img=comicInfo.getBaseUrl(url)+"/books/"+books[x].get("id"),
|
current_chapter_img=comicInfo.getBaseUrl(url)+"/books/"+books[x].get("id"),
|
||||||
|
|||||||
+3
-4
@@ -53,9 +53,7 @@ class htmlUtils:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def getHTML(cls, curl,type=None,update=False):
|
def getHTML(cls, curl,type=None,update=False):
|
||||||
url_text = None
|
url_text = None
|
||||||
retries = Retry(total=1,
|
retries = Retry(total=1, backoff_factor=0.1, status_forcelist=[ 500, 502, 503, 504 ])
|
||||||
backoff_factor=0.1,
|
|
||||||
status_forcelist=[ 500, 502, 503, 504 ])
|
|
||||||
s = requests.Session()
|
s = requests.Session()
|
||||||
s.mount('http://', HTTPAdapter(max_retries=retries))
|
s.mount('http://', HTTPAdapter(max_retries=retries))
|
||||||
s.mount('https://', HTTPAdapter(max_retries=retries))
|
s.mount('https://', HTTPAdapter(max_retries=retries))
|
||||||
@@ -101,7 +99,8 @@ class htmlUtils:
|
|||||||
return cls.getHTML(url,type="bytes")
|
return cls.getHTML(url,type="bytes")
|
||||||
|
|
||||||
@classmethod
|
@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")
|
return cls.getHTML(url,type="json")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in new issue
Block a user