4
0
mirror of https://github.com/RicterZ/nhentai.git synced 2025-05-06 03:21:07 +02:00

Fixing loop when id not found, issue

This commit is contained in:
mobrine1 2021-01-07 07:32:29 -05:00 committed by GitHub
parent 0cd2576dab
commit 72035a14e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -118,6 +118,9 @@ def doujinshi_parser(id_):
response = request('get', url) response = request('get', url)
if response.status_code in (200,): if response.status_code in (200,):
response = response.content response = response.content
elif response.status_code in (404,):
logger.error("Doujinshi with id {0} cannot be found".format(id_))
return []
else: else:
logger.debug('Slow down and retry ({}) ...'.format(id_)) logger.debug('Slow down and retry ({}) ...'.format(id_))
time.sleep(1) time.sleep(1)