fix fanza

This commit is contained in:
jnozsc
2020-07-25 14:13:49 -07:00
parent efd1152d56
commit aca32b3cdc

View File

@@ -2,6 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import json import json
import re import re
from urllib.parse import urlencode
from lxml import etree from lxml import etree
@@ -108,7 +109,7 @@ def getRelease(text):
)[0].lstrip("\n") )[0].lstrip("\n")
except: except:
pass pass
return result.replace('/','-') return result.replace("/", "-")
def getTag(text): def getTag(text):
@@ -187,8 +188,7 @@ def getSeries(text):
)[0] )[0]
return result return result
except: except:
return '' return ""
def main(number): def main(number):
@@ -210,9 +210,14 @@ def main(number):
"https://www.dmm.co.jp/digital/nikkatsu/-/detail/=/cid=", "https://www.dmm.co.jp/digital/nikkatsu/-/detail/=/cid=",
] ]
chosen_url = "" chosen_url = ""
for url in fanza_urls: for url in fanza_urls:
chosen_url = url + fanza_search_number 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: if "404 Not Found" not in htmlcode:
break break
if "404 Not Found" in htmlcode: if "404 Not Found" in htmlcode:
@@ -284,4 +289,4 @@ def main_htmlcode(number):
if __name__ == "__main__": if __name__ == "__main__":
print(main("DV-1562")) print(main("DV-1562"))