From c20bf4cf57549e28690a51d51ca3a205a6f0572f Mon Sep 17 00:00:00 2001 From: lededev Date: Fri, 8 Apr 2022 14:17:50 +0800 Subject: [PATCH] fanza.py:resolve some [-]Movie number has changed --- WebCrawler/fanza.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WebCrawler/fanza.py b/WebCrawler/fanza.py index 00d8988..e9b25ef 100644 --- a/WebCrawler/fanza.py +++ b/WebCrawler/fanza.py @@ -250,6 +250,9 @@ def main(number): # but the hinban on the page is test00012 # so get the hinban first, and then pass it to following functions fanza_hinban = getNum(htmlcode) + out_num = fanza_hinban + if re.sub('-|_', '', number.lower()) == fanza_hinban: + out_num = number data = { "title": getTitle(htmlcode).strip(), "studio": getStudio(htmlcode), @@ -258,7 +261,7 @@ def main(number): "director": getDirector(htmlcode) if "anime" not in chosen_url else "", "actor": getActor(htmlcode) if "anime" not in chosen_url else "", "release": getRelease(htmlcode), - "number": fanza_hinban, + "number": out_num, "cover": getCover(htmlcode, fanza_hinban), "imagecut": 1, "tag": getTag(htmlcode), @@ -315,3 +318,5 @@ if __name__ == "__main__": # print(main("DV-1562")) # print(main("96fad1217")) print(main("pred00251")) + print(main("MIAA-391")) + print(main("OBA-326"))