From d1d0c22af896a5fc6ab3701fb6b2d261a13a74d1 Mon Sep 17 00:00:00 2001 From: ricterz Date: Sat, 11 Jan 2025 08:34:30 +0800 Subject: [PATCH] fix #349 --- nhentai/parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nhentai/parser.py b/nhentai/parser.py index 7e6b035..ab30235 100644 --- a/nhentai/parser.py +++ b/nhentai/parser.py @@ -159,10 +159,10 @@ def doujinshi_parser(id_, counter=0): for i in html.find_all('div', attrs={'class': 'thumb-container'}): base_name = os.path.basename(i.img.attrs['data-src']) ext_name = base_name.split('.') - if len(ext_name) == 2: - ext.append(ext_name[-1]) - elif len(ext_name) == 3: + if len(ext_name) == 3: ext.append(ext_name[1]) + else: + ext.append(ext_name[-1]) if not img_id: logger.critical(f'Tried yo get image id failed of id: {id_}')