From 13b584a820a565d206fcd2f5d87b1fdf3dc1417c Mon Sep 17 00:00:00 2001 From: ricterz Date: Sat, 11 Jan 2025 08:02:36 +0800 Subject: [PATCH] fix #371 and #324 --- README.rst | 2 +- nhentai/cmdline.py | 2 +- nhentai/command.py | 2 +- nhentai/utils.py | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 189bdb0..3e45bc5 100644 --- a/README.rst +++ b/README.rst @@ -129,7 +129,7 @@ Download your favorites with delay: .. code-block:: bash - nhentai --favorites --download --delay 1 + nhentai --favorites --download --delay 1 --page 3-5,7 Format output doujinshi folder name: diff --git a/nhentai/cmdline.py b/nhentai/cmdline.py index c5c996b..f08d0b2 100644 --- a/nhentai/cmdline.py +++ b/nhentai/cmdline.py @@ -79,7 +79,7 @@ def cmd_parser(): # page options parser.add_option('--page-all', dest='page_all', action='store_true', default=False, help='all search results') - parser.add_option('--page', '--page-range', type='string', dest='page', action='store', default='1', + parser.add_option('--page', '--page-range', type='string', dest='page', action='store', help='page number of search results. e.g. 1,2-5,14') parser.add_option('--sorting', '--sort', dest='sorting', action='store', default='popular', help='sorting of doujinshi (recent / popular / popular-[today|week])', diff --git a/nhentai/command.py b/nhentai/command.py index 39607b1..4032a16 100644 --- a/nhentai/command.py +++ b/nhentai/command.py @@ -48,7 +48,7 @@ def main(): if not options.is_download: logger.warning('You do not specify --download option') - doujinshis = favorites_parser() if options.page_all else favorites_parser(page=page_list) + doujinshis = favorites_parser(page=page_list) if options.page else favorites_parser() elif options.keyword: if constant.CONFIG['language']: diff --git a/nhentai/utils.py b/nhentai/utils.py index 1f899ec..edaea5c 100644 --- a/nhentai/utils.py +++ b/nhentai/utils.py @@ -311,7 +311,8 @@ def signal_handler(_signal, _frame): def paging(page_string): # 1,3-5,14 -> [1, 3, 4, 5, 14] if not page_string: - return [] + # default, the first page + return [1] page_list = [] for i in page_string.split(','):