From e89c2c08606ddd7ced05685a3330310e2915eafd Mon Sep 17 00:00:00 2001 From: Ricter Z Date: Sun, 5 Feb 2023 07:02:45 +0800 Subject: [PATCH] fix bug #265 --- nhentai/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nhentai/parser.py b/nhentai/parser.py index 1e470a4..ef4dfc7 100644 --- a/nhentai/parser.py +++ b/nhentai/parser.py @@ -184,7 +184,7 @@ def legacy_search_parser(keyword, sorting, page, is_page_all=False): response = None result = [] - if is_page_all: + if is_page_all and len(page) != 1: # `--page-all` option will override the `--page` option page = [1] @@ -208,7 +208,7 @@ def legacy_search_parser(keyword, sorting, page, is_page_all=False): return result else: next_page = re.findall('page=([0-9]+)', next_page.attrs['href'])[0] - result.extend(legacy_search_parser(keyword, sorting, next_page, is_page_all)) + result.extend(legacy_search_parser(keyword, sorting, [next_page], is_page_all)) return result return result