Fix single actor in fanza

This commit is contained in:
yoshiko2
2022-06-01 22:20:28 +08:00
parent 99cc99bb51
commit 5b550dccfd

View File

@@ -123,13 +123,21 @@ def main(number):
number_lo.replace('-', '') + 'so' == fanza_hinban number_lo.replace('-', '') + 'so' == fanza_hinban
): ):
out_num = number out_num = number
director = fanza_Crawler.getFanzaString('監督:')
if "anime" in chosen_url:
director = ""
actor = fanza_Crawler.getStrings("//td[contains(text(),'出演者')]/following-sibling::td/span/a/text()")
if "anime" in chosen_url:
actor = ""
data = { data = {
"title": fanza_Crawler.getString('//*[starts-with(@id, "title")]/text()').strip(), "title": fanza_Crawler.getString('//*[starts-with(@id, "title")]/text()').strip(),
"studio": fanza_Crawler.getFanzaString('メーカー'), "studio": fanza_Crawler.getFanzaString('メーカー'),
"outline": getOutline(html), "outline": getOutline(html),
"runtime": str(re.search(r'\d+',fanza_Crawler.getString("//td[contains(text(),'収録時間')]/following-sibling::td/text()")).group()).strip(" ['']"), "runtime": str(re.search(r'\d+',fanza_Crawler.getString("//td[contains(text(),'収録時間')]/following-sibling::td/text()")).group()).strip(" ['']"),
"director": fanza_Crawler.getFanzaString('監督:') if "anime" not in chosen_url else "", "director": director,
"actor": fanza_Crawler.getString("//td[contains(text(),'出演者')]/following-sibling::td/span/a/text()").replace("', '", ",") if "anime" not in chosen_url else "", "actor": actor,
"release": getRelease(fanza_Crawler), "release": getRelease(fanza_Crawler),
"number": out_num, "number": out_num,
"cover": getCover(html, fanza_hinban), "cover": getCover(html, fanza_hinban),
@@ -143,7 +151,7 @@ def main(number):
"source": "fanza.py", "source": "fanza.py",
"series": fanza_Crawler.getFanzaString('シリーズ:'), "series": fanza_Crawler.getFanzaString('シリーズ:'),
} }
except: except Exception as e:
data = { data = {
"title": "", "title": "",
} }
@@ -185,6 +193,6 @@ def main_htmlcode(number):
if __name__ == "__main__": if __name__ == "__main__":
# print(main("DV-1562")) # print(main("DV-1562"))
# print(main("96fad1217")) # print(main("96fad1217"))
print(main("pred00251")) print(main("AES-002"))
print(main("MIAA-391")) print(main("MIAA-391"))
print(main("OBA-326")) print(main("OBA-326"))