fix getchu
headers extrafanart
This commit is contained in:
@@ -88,7 +88,17 @@ class wwwGetchu(Parser):
|
|||||||
extrafanart.append(i)
|
extrafanart.append(i)
|
||||||
return extrafanart
|
return extrafanart
|
||||||
|
|
||||||
|
def extradict(self, dic: dict):
|
||||||
|
""" 额外新增的 headers
|
||||||
|
"""
|
||||||
|
dic['headers'] = {'referer': self.detailurl}
|
||||||
|
return dic
|
||||||
|
|
||||||
class dlGetchu(wwwGetchu):
|
class dlGetchu(wwwGetchu):
|
||||||
|
""" 二者基本一致
|
||||||
|
headers extrafanart 略有区别
|
||||||
|
"""
|
||||||
|
|
||||||
imagecut = 4
|
imagecut = 4
|
||||||
allow_number_change = True
|
allow_number_change = True
|
||||||
|
|
||||||
@@ -127,3 +137,14 @@ class dlGetchu(wwwGetchu):
|
|||||||
|
|
||||||
def getCover(self, htmltree):
|
def getCover(self, htmltree):
|
||||||
return "https://dl.getchu.com" + super().getCover(htmltree)
|
return "https://dl.getchu.com" + super().getCover(htmltree)
|
||||||
|
|
||||||
|
def extradict(self, dic: dict):
|
||||||
|
return dic
|
||||||
|
|
||||||
|
def getExtrafanart(self, htmltree):
|
||||||
|
arts = self.getTreeAll(htmltree, self.expr_extrafanart)
|
||||||
|
extrafanart = []
|
||||||
|
for i in arts:
|
||||||
|
i = "https://dl.getchu.com" + i
|
||||||
|
extrafanart.append(i)
|
||||||
|
return extrafanart
|
||||||
|
|||||||
@@ -135,12 +135,18 @@ class Parser:
|
|||||||
'userrating': self.getUserRating(htmltree),
|
'userrating': self.getUserRating(htmltree),
|
||||||
'uservotes': self.getUserVotes(htmltree)
|
'uservotes': self.getUserVotes(htmltree)
|
||||||
}
|
}
|
||||||
|
dic = self.extradict(dic)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
dic = {"title": ""}
|
dic = {"title": ""}
|
||||||
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), )
|
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), )
|
||||||
return js
|
return js
|
||||||
|
|
||||||
|
def extradict(self, dic:dict):
|
||||||
|
""" 额外修改dict
|
||||||
|
"""
|
||||||
|
return dic
|
||||||
|
|
||||||
def getNum(self, htmltree):
|
def getNum(self, htmltree):
|
||||||
""" 增加 strip 过滤
|
""" 增加 strip 过滤
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user