7 _ __ | | | | ___ _ __ | |_ __ _(_)
8 | '_ \| |_| |/ _ \ '_ \| __/ _` | |
9 | | | | _ | __/ | | | || (_| | |
10 |_| |_|_| |_|\___|_| |_|\__\__,_|_|
20 nHentai is a CLI tool for downloading doujinshi from <http://nhentai.net>
27 git clone https://github.com/RicterZ/nhentai
29 python setup.py install
34 Alternatively, install from PyPI with pip:
40 For a self-contained installation, use `Pipx <https://github.com/pipxproject/pipx/>`_:
52 sudo emerge net-misc/nhentai
57 **IMPORTANT**: To bypass the nhentai frequency limit, you should use `--cookie` option to store your cookie.
59 *The default download folder will be the path where you run the command (CLI path).*
62 Set your nhentai cookie against captcha:
66 nhentai --cookie "YOUR COOKIE FROM nhentai.net"
68 **NOTE**: The format of the cookie is `"csrftoken=TOKEN; sessionid=ID"`
70 | To get csrftoken and sessionid, first login to your nhentai account in web browser, then:
71 | (Chrome) |ve| |ld| More tools |ld| Developer tools |ld| Application |ld| Storage |ld| Cookies |ld| https://nhentai.net
72 | (Firefox) |hv| |ld| Web Developer |ld| Web Developer Tools |ld| Storage |ld| Cookies |ld| https://nhentai.net
75 .. |hv| unicode:: U+2630 .. https://www.compart.com/en/unicode/U+2630
76 .. |ve| unicode:: U+22EE .. https://www.compart.com/en/unicode/U+22EE
77 .. |ld| unicode:: U+2014 .. https://www.compart.com/en/unicode/U+2014
79 Download specified doujinshi:
83 nhentai --id=123855,123866
85 Download doujinshi with ids specified in a file (doujinshi ids split by line):
89 nhentai --file=doujinshi.txt
91 Set search default language
95 nhentai --language=english
97 Search a keyword and download the first page:
101 nhentai --search="tomori" --page=1 --download
102 # you also can download by tags and multiple keywords
103 nhentai --search="tag:lolicon, artist:henreader, tag:full color"
104 nhentai --search="lolicon, henreader, full color"
106 Download your favorites with delay:
110 nhentai --favorites --download --delay 1
112 Format output doujinshi folder name:
116 nhentai --id 261100 --format '[%i]%s'
118 Supported doujinshi folder formatter:
122 - %s: Doujinshi subtitle (translated name)
123 - %a: Doujinshi authors' name
124 - %p: Doujinshi pretty name
133 -h, --help show this help message and exit
134 -D, --download download doujinshi (for search results)
135 -S, --show just show the doujinshi information
138 --id=ID doujinshi ids set, e.g. 1,2,3
139 -s KEYWORD, --search=KEYWORD
140 search doujinshi by keyword
141 --tag=TAG download doujinshi by tag
142 -F, --favorites list or download your favorites.
145 --page=PAGE page number of search results
146 --max-page=MAX_PAGE The max page when recursive download tagged doujinshi
149 -o OUTPUT_DIR, --output=OUTPUT_DIR
151 -t THREADS, --threads=THREADS
152 thread count for downloading doujinshi
153 -T TIMEOUT, --timeout=TIMEOUT
154 timeout for downloading doujinshi
155 -d DELAY, --delay=DELAY
156 slow down between downloading every doujinshi
157 -p PROXY, --proxy=PROXY
158 uses a proxy, for example: http://127.0.0.1:1080
159 -f FILE, --file=FILE read gallery IDs from file.
160 --format=NAME_FORMAT format the saved folder name
163 --html generate a html viewer at current directory
164 --no-html don't generate HTML after downloading
165 --gen-main generate a main viewer contain all the doujin in the folder
166 -C, --cbz generate Comic Book CBZ File
167 -P --pdf generate PDF file
168 --rm-origin-dir remove downloaded doujinshi dir when generated CBZ
172 --cookie=COOKIE set cookie of nhentai to bypass Google recaptcha
178 If you want to use a mirror, you should set up a reverse proxy of `nhentai.net` and `i.nhentai.net`.
183 i.h.loli.club -> i.nhentai.net
184 h.loli.club -> nhentai.net
186 Set `NHENTAI` env var to your nhentai mirror.
190 NHENTAI=http://h.loli.club nhentai --id 123456
193 .. image:: ./images/search.png?raw=true
196 .. image:: ./images/download.png?raw=true
199 .. image:: ./images/viewer.png?raw=true
206 .. image:: ./images/image.jpg?raw=true
212 .. |travis| image:: https://travis-ci.org/RicterZ/nhentai.svg?branch=master
213 :target: https://travis-ci.org/RicterZ/nhentai
215 .. |pypi| image:: https://img.shields.io/pypi/dm/nhentai.svg
216 :target: https://pypi.org/project/nhentai/
218 .. |license| image:: https://img.shields.io/github/license/ricterz/nhentai.svg
219 :target: https://github.com/RicterZ/nhentai/blob/master/LICENSE