Merge pull request #189 from mobrine1/mobrine1-patch-1

Fixing loop when id not found, issue #188
This commit is contained in:
Ricter Zheng 2021-01-07 20:39:44 +08:00 committed by GitHub
commit edc46a9531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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