Add euc_jp encode in source getchu #2

This commit is contained in:
yoshiko2
2022-05-22 02:19:26 +08:00
parent 37533e5552
commit 93e5fd2a35

View File

@@ -29,6 +29,7 @@ def main(number):
"actor_photo": "", "actor_photo": "",
"website": "https://dl.getchu.com/i/" + number, "website": "https://dl.getchu.com/i/" + number,
"source": "getchu.py", "source": "getchu.py",
"allow_number_change": True,
} }
extrafanart = [] extrafanart = []
for i in dic['extrafanart']: for i in dic['extrafanart']:
@@ -36,7 +37,7 @@ def main(number):
extrafanart.append(i) extrafanart.append(i)
dic['extrafanart'] = extrafanart dic['extrafanart'] = extrafanart
else: else:
number = number #quote(number,encoding="GBK") display_number = number #quote(number,encoding="GBK")
url = f'http://www.getchu.com/php/search.phtml?genre=anime_dvd&search_keyword={number}&check_key_dtl=1&submit=' url = f'http://www.getchu.com/php/search.phtml?genre=anime_dvd&search_keyword={number}&check_key_dtl=1&submit='
htmlcode = get_html(url,cookies={'getchu_adalt_flag':'getchu.com'}) htmlcode = get_html(url,cookies={'getchu_adalt_flag':'getchu.com'})
getchu = Crawler(htmlcode) getchu = Crawler(htmlcode)
@@ -66,7 +67,7 @@ def main(number):
"outline": getchu.getStrings("//div[contains(text(),'商品紹介')]/following-sibling::div/text()"), "outline": getchu.getStrings("//div[contains(text(),'商品紹介')]/following-sibling::div/text()"),
"extrafanart": getchu.getStrings("//div[contains(text(),'サンプル画像')]/following-sibling::div/a/@href"), "extrafanart": getchu.getStrings("//div[contains(text(),'サンプル画像')]/following-sibling::div/a/@href"),
"series": getchu.getString("//td[contains(text(),'ジャンル:')]/following-sibling::td/text()").strip(), "series": getchu.getString("//td[contains(text(),'ジャンル:')]/following-sibling::td/text()").strip(),
"number": number, "number": display_number,
"imagecut": 0, "imagecut": 0,
"year": str(re.findall('\d{4}', str(getchu.getString( "year": str(re.findall('\d{4}', str(getchu.getString(
"//td[contains(text(),'発売日:')]/following-sibling::td/a/text()").replace("/","-")))).strip(" ['']"), "//td[contains(text(),'発売日:')]/following-sibling::td/a/text()").replace("/","-")))).strip(" ['']"),
@@ -74,6 +75,7 @@ def main(number):
"website": url2, "website": url2,
"headers":{'referer': url2}, "headers":{'referer': url2},
"source": "getchu.py", "source": "getchu.py",
"allow_number_change": True,
} }
extrafanart = [] extrafanart = []
for i in dic['extrafanart']: for i in dic['extrafanart']: