]> git.lizzy.rs Git - nhentai.git/commitdiff
Fixing loop when id not found, issue #188
authormobrine1 <33225846+mobrine1@users.noreply.github.com>
Thu, 7 Jan 2021 12:32:29 +0000 (07:32 -0500)
committerGitHub <noreply@github.com>
Thu, 7 Jan 2021 12:32:29 +0000 (07:32 -0500)
nhentai/parser.py

index 484c0f6feeceb6d6352a719f1055f55a7597e2c4..0df571005a29a0db1f908e4bd026db0d3bf5fd56 100644 (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)