From aca32b3cdc12a61da78cdc56f123c0db86f6d941 Mon Sep 17 00:00:00 2001 From: jnozsc <470215+jnozsc@users.noreply.github.com> Date: Sat, 25 Jul 2020 14:13:49 -0700 Subject: [PATCH] fix fanza --- fanza.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/fanza.py b/fanza.py index d33abc7..617949a 100644 --- a/fanza.py +++ b/fanza.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import json import re +from urllib.parse import urlencode from lxml import etree @@ -108,7 +109,7 @@ def getRelease(text): )[0].lstrip("\n") except: pass - return result.replace('/','-') + return result.replace("/", "-") def getTag(text): @@ -187,8 +188,7 @@ def getSeries(text): )[0] return result except: - return '' - + return "" def main(number): @@ -210,9 +210,14 @@ def main(number): "https://www.dmm.co.jp/digital/nikkatsu/-/detail/=/cid=", ] chosen_url = "" + for url in fanza_urls: chosen_url = url + fanza_search_number - htmlcode = get_html(chosen_url) + htmlcode = get_html( + "https://www.dmm.co.jp/age_check/=/declared=yes/?{}".format( + urlencode({"rurl": chosen_url}) + ) + ) if "404 Not Found" not in htmlcode: break if "404 Not Found" in htmlcode: @@ -284,4 +289,4 @@ def main_htmlcode(number): if __name__ == "__main__": - print(main("DV-1562")) \ No newline at end of file + print(main("DV-1562"))