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
132 -h, --help show this help message and exit
133 -D, --download download doujinshi (for search results)
134 -S, --show just show the doujinshi information
137 --id=ID doujinshi ids set, e.g. 1,2,3
138 -s KEYWORD, --search=KEYWORD
139 search doujinshi by keyword
140 --tag=TAG download doujinshi by tag
141 -F, --favorites list or download your favorites.
144 --page=PAGE page number of search results
145 --max-page=MAX_PAGE The max page when recursive download tagged doujinshi
148 -o OUTPUT_DIR, --output=OUTPUT_DIR
150 -t THREADS, --threads=THREADS
151 thread count for downloading doujinshi
152 -T TIMEOUT, --timeout=TIMEOUT
153 timeout for downloading doujinshi
154 -d DELAY, --delay=DELAY
155 slow down between downloading every doujinshi
156 -p PROXY, --proxy=PROXY
157 uses a proxy, for example: http://127.0.0.1:1080
158 -f FILE, --file=FILE read gallery IDs from file.
159 --format=NAME_FORMAT format the saved folder name
162 --html generate a html viewer at current directory
163 --no-html don't generate HTML after downloading
164 --gen-main generate a main viewer contain all the doujin in the folder
165 -C, --cbz generate Comic Book CBZ File
166 -P --pdf generate PDF file
167 --rm-origin-dir remove downloaded doujinshi dir when generated CBZ
171 --cookie=COOKIE set cookie of nhentai to bypass Google recaptcha
177 If you want to use a mirror, you should set up a reverse proxy of `nhentai.net` and `i.nhentai.net`.
182 i.h.loli.club -> i.nhentai.net
183 h.loli.club -> nhentai.net
185 Set `NHENTAI` env var to your nhentai mirror.
189 NHENTAI=http://h.loli.club nhentai --id 123456
192 .. image:: ./images/search.png?raw=true
195 .. image:: ./images/download.png?raw=true
198 .. image:: ./images/viewer.png?raw=true
205 .. image:: ./images/image.jpg?raw=true
211 .. |travis| image:: https://travis-ci.org/RicterZ/nhentai.svg?branch=master
212 :target: https://travis-ci.org/RicterZ/nhentai
214 .. |pypi| image:: https://img.shields.io/pypi/dm/nhentai.svg
215 :target: https://pypi.org/project/nhentai/
217 .. |license| image:: https://img.shields.io/github/license/ricterz/nhentai.svg
218 :target: https://github.com/RicterZ/nhentai/blob/master/LICENSE