add edge case

This commit is contained in:
jnozsc 2020-02-16 15:00:29 -08:00 committed by GitHub
parent 8dda8da2b3
commit dabe1f2da6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,6 +82,9 @@ def main(number):
if '404 Not Found' in htmlcode:
htmlcode=get_html('https://www.dmm.co.jp/mono/dvd/-/detail/=/cid='+number)
url = 'https://www.dmm.co.jp/mono/dvd/-/detail/=/cid='+number
if '404 Not Found' in htmlcode:
# neither digital nor mono is available
return json.dumps({'title': '',})
try:
# for some old page, the input number does not match the page
# for example, the url will be cid=test012