From: RicterZ Date: Sun, 10 Jan 2021 03:44:04 +0000 (+0800) Subject: fix #188 X-Git-Tag: 0.4.11~5 X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=2f9386f22c630c461599072f6843d0542fe041d0;p=nhentai.git fix #188 --- diff --git a/nhentai/parser.py b/nhentai/parser.py index 484c0f6..be6643c 100644 --- a/nhentai/parser.py +++ b/nhentai/parser.py @@ -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)