Skip to content

Commit

Permalink
fix #371 and #324
Browse files Browse the repository at this point in the history
  • Loading branch information
RicterZ committed Jan 11, 2025
1 parent be08fcf commit 13b584a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion nhentai/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])',
Expand Down
2 changes: 1 addition & 1 deletion nhentai/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']:
Expand Down
3 changes: 2 additions & 1 deletion nhentai/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(','):
Expand Down

0 comments on commit 13b584a

Please sign in to comment.