update README

This commit is contained in:
Ricter Z 2023-02-05 23:25:41 +08:00
parent 466fa4c094
commit 8c900a833d
3 changed files with 17 additions and 15 deletions

View File

@ -95,7 +95,7 @@ Download specified doujinshi:
.. code-block:: bash
nhentai --id=123855,123866
nhentai --id 123855 123866 123877
Download doujinshi with ids specified in a file (doujinshi ids split by line):
@ -145,7 +145,7 @@ Other options:
Usage:
nhentai --search [keyword] --download
NHENTAI=http://h.loli.club nhentai --id [ID ...]
NHENTAI=https://nhentai-mirror-url/ nhentai --id [ID ...]
nhentai --file [filename]
Environment Variable:
@ -158,10 +158,10 @@ Other options:
-S, --show just show the doujinshi information
# Doujinshi options, specify id, keyword, etc.
--id=ID doujinshi ids set, e.g. 1,2,3
--id doujinshi ids set, e.g. 167680 167681 167682
-s KEYWORD, --search=KEYWORD
search doujinshi by keyword
-F, --favorites list or download your favorites.
-F, --favorites list or download your favorites
# Page options, control the page to fetch / download
--page-all all search results
@ -179,10 +179,10 @@ Other options:
timeout for downloading doujinshi
-d DELAY, --delay=DELAY
slow down between downloading every doujinshi
--proxy=PROXY store a proxy, for example: -p 'http://127.0.0.1:1080'
--proxy=PROXY store a proxy, for example: -p "http://127.0.0.1:1080"
-f FILE, --file=FILE read gallery IDs from file.
--format=NAME_FORMAT format the saved folder name
-r, --dry-run Dry run, skip file download.
--dry-run Dry run, skip file download
# Generate options, for generate html viewer, cbz file, pdf file, etc
--html generate a html viewer at current directory
@ -192,13 +192,13 @@ Other options:
-C, --cbz generate Comic Book CBZ File
-P, --pdf generate PDF file
--rm-origin-dir remove downloaded doujinshi dir when generated CBZ or
PDF file.
PDF file
--meta generate a metadata file in doujinshi format
--regenerate-cbz regenerate the cbz file if exists
# nhentai options, set cookie, user-agent, language, remove caches, histories, etc
--cookie=COOKIE set cookie of nhentai to bypass Cloudflare captcha
--useragent=USERAGENT
--useragent=USERAGENT, --user-agent=USERAGENT
set useragent to bypass Cloudflare captcha
--language=LANGUAGE set default language to parse doujinshis
--clean-language set DEFAULT as language to parse doujinshis
@ -209,6 +209,7 @@ Other options:
clean download history
--template=VIEWER_TEMPLATE
set viewer template
--legacy use legacy searching method
==============
nHentai Mirror
@ -225,7 +226,7 @@ Set `NHENTAI` env var to your nhentai mirror.
.. code-block:: bash
NHENTAI=http://h.loli.club nhentai --id 123456
NHENTAI=https://h.loli.club nhentai --id 123456
.. image:: ./images/search.png?raw=true

View File

@ -75,7 +75,7 @@ def cmd_parser():
parser.add_option('--search', '-s', type='string', dest='keyword', action='store',
help='search doujinshi by keyword')
parser.add_option('--favorites', '-F', action='store_true', dest='favorites',
help='list or download your favorites.')
help='list or download your favorites')
# page options
parser.add_option('--page-all', dest='page_all', action='store_true', default=False,
@ -100,7 +100,7 @@ def cmd_parser():
parser.add_option('--file', '-f', type='string', dest='file', action='store', help='read gallery IDs from file.')
parser.add_option('--format', type='string', dest='name_format', action='store',
help='format the saved folder name', default='[%i][%a][%t]')
parser.add_option('--dry-run', '-r', action='store_true', dest='dryrun', help='Dry run, skip file download.')
parser.add_option('--dry-run', action='store_true', dest='dryrun', help='Dry run, skip file download')
# generate options
parser.add_option('--html', dest='html_viewer', action='store_true',
@ -114,7 +114,7 @@ def cmd_parser():
parser.add_option('--pdf', '-P', dest='is_pdf', action='store_true',
help='generate PDF file')
parser.add_option('--rm-origin-dir', dest='rm_origin_dir', action='store_true', default=False,
help='remove downloaded doujinshi dir when generated CBZ or PDF file.')
help='remove downloaded doujinshi dir when generated CBZ or PDF file')
parser.add_option('--meta', dest='generate_metadata', action='store_true',
help='generate a metadata file in doujinshi format')
parser.add_option('--regenerate-cbz', dest='regenerate_cbz', action='store_true', default=False,

View File

@ -2,6 +2,7 @@
import sys
import signal
import platform
import urllib3.exceptions
from nhentai import constant
from nhentai.cmdline import cmd_parser, banner
@ -118,8 +119,8 @@ def main():
doujinshi.show()
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
signal.signal(signal.SIGINT, signal_handler)
if __name__ == '__main__':
import urllib3.exceptions
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
signal.signal(signal.SIGINT, signal_handler)
main()