]> git.lizzy.rs Git - nhentai.git/commitdiff
fix #188
authorRicterZ <ricterzheng@gmail.com>
Sun, 10 Jan 2021 03:44:04 +0000 (11:44 +0800)
committerRicterZ <ricterzheng@gmail.com>
Sun, 10 Jan 2021 03:44:04 +0000 (11:44 +0800)
nhentai/parser.py

index 484c0f6feeceb6d6352a719f1055f55a7597e2c4..be6643c5949ee0dd84f7fc1d7853dbe86f3a8206 100644 (file)
@@ -116,8 +116,10 @@ def doujinshi_parser(id_):
 
     try:
         response = request('get', url)
-        if response.status_code in (200,):
+        if response.status_code in (200, ):
             response = response.content
+        elif response.status_code in (404, ):
+            raise Exception('Seems doujinshi {} does not exist'.format(id_))
         else:
             logger.debug('Slow down and retry ({}) ...'.format(id_))
             time.sleep(1)