]> git.lizzy.rs Git - nhentai.git/blob - README.rst
Add new option to avoid cloudflare captcha
[nhentai.git] / README.rst
1 nhentai
2 =======
3
4 .. code-block::
5
6            _   _            _        _
7      _ __ | | | | ___ _ __ | |_ __ _(_)
8     | '_ \| |_| |/ _ \ '_ \| __/ _` | |
9     | | | |  _  |  __/ | | | || (_| | |
10     |_| |_|_| |_|\___|_| |_|\__\__,_|_|
11
12
13 あなたも変態。 いいね?
14
15 |travis|
16 |pypi|
17 |license|
18
19
20 nHentai is a CLI tool for downloading doujinshi from <http://nhentai.net>
21
22 ===================
23 Manual Installation
24 ===================
25 .. code-block::
26
27     git clone https://github.com/RicterZ/nhentai
28     cd nhentai
29     python setup.py install
30
31 ==================
32 Installation (pip)
33 ==================
34 Alternatively, install from PyPI with pip:
35
36 .. code-block::
37
38            pip install nhentai
39
40 For a self-contained installation, use `Pipx <https://github.com/pipxproject/pipx/>`_:
41
42 .. code-block::
43
44            pipx install nhentai
45
46 =====================
47 Installation (Gentoo)
48 =====================
49 .. code-block::
50
51     layman -fa glicOne
52     sudo emerge net-misc/nhentai
53     
54 =====================
55 Installation (NixOs)
56 =====================
57 .. code-block::
58
59     nix-env -iA nixos.nhentai
60     
61 =====
62 Usage
63 =====
64 **IMPORTANT**: To bypass the nhentai frequency limit, you should use `--cookie` option to store your cookie.
65
66 *The default download folder will be the path where you run the command (CLI path).*
67
68
69 Set your nhentai cookie against captcha:
70
71 .. code-block:: bash
72
73     nhentai --cookie "YOUR COOKIE FROM nhentai.net"
74
75 **NOTE**: The format of the cookie is `"csrftoken=TOKEN; sessionid=ID; cf_chl_2=CLOUDFLARE; cf_chl_prog=CLOUDFLARE; cf_clearance=CLOUDFLARE"`
76
77 | To get csrftoken and sessionid, first login to your nhentai account in web browser, then:
78 | (Chrome) |ve| |ld| More tools    |ld| Developer tools     |ld| Application |ld| Storage |ld| Cookies |ld| https://nhentai.net
79 | (Firefox) |hv| |ld| Web Developer |ld| Web Developer Tools                  |ld| Storage |ld| Cookies |ld| https://nhentai.net
80
81
82 .. |hv| unicode:: U+2630 .. https://www.compart.com/en/unicode/U+2630
83 .. |ve| unicode:: U+22EE .. https://www.compart.com/en/unicode/U+22EE
84 .. |ld| unicode:: U+2014 .. https://www.compart.com/en/unicode/U+2014
85
86 Download specified doujinshi:
87
88 .. code-block:: bash
89
90     nhentai --id=123855,123866
91
92 Download doujinshi with ids specified in a file (doujinshi ids split by line):
93
94 .. code-block:: bash
95
96     nhentai --file=doujinshi.txt
97
98 Set search default language
99
100 .. code-block:: bash
101
102     nhentai --language=english
103
104 Search a keyword and download the first page:
105
106 .. code-block:: bash
107
108     nhentai --search="tomori" --page=1 --download
109     # you also can download by tags and multiple keywords
110     nhentai --search="tag:lolicon, artist:henreader, tag:full color"
111     nhentai --search="lolicon, henreader, full color"
112
113 Download your favorites with delay:
114
115 .. code-block:: bash
116
117     nhentai --favorites --download --delay 1
118
119 Format output doujinshi folder name:
120
121 .. code-block:: bash
122
123     nhentai --id 261100 --format '[%i]%s'
124
125 Supported doujinshi folder formatter:
126
127 - %i: Doujinshi id
128 - %t: Doujinshi name
129 - %s: Doujinshi subtitle (translated name)
130 - %a: Doujinshi authors' name
131 - %p: Doujinshi pretty name
132
133
134 Other options:
135
136 .. code-block::
137
138     Options:
139       # Operation options
140       -h, --help            show this help message and exit
141       -D, --download        download doujinshi (for search results)
142       -S, --show            just show the doujinshi information
143
144       # Doujinshi options
145       --id=ID               doujinshi ids set, e.g. 1,2,3
146       -s KEYWORD, --search=KEYWORD
147                             search doujinshi by keyword
148       --tag=TAG             download doujinshi by tag
149       -F, --favorites       list or download your favorites.
150
151       # Multi-page options
152       --page=PAGE           page number of search results
153       --max-page=MAX_PAGE   The max page when recursive download tagged doujinshi
154
155       # Download options
156       -o OUTPUT_DIR, --output=OUTPUT_DIR
157                             output dir
158       -t THREADS, --threads=THREADS
159                             thread count for downloading doujinshi
160       -T TIMEOUT, --timeout=TIMEOUT
161                             timeout for downloading doujinshi
162       -d DELAY, --delay=DELAY
163                             slow down between downloading every doujinshi
164       -p PROXY, --proxy=PROXY
165                             uses a proxy, for example: http://127.0.0.1:1080
166       -f FILE, --file=FILE  read gallery IDs from file.
167       --format=NAME_FORMAT  format the saved folder name
168
169       # Generating options
170       --html                generate a html viewer at current directory
171       --no-html             don't generate HTML after downloading
172       --gen-main            generate a main viewer contain all the doujin in the folder
173       -C, --cbz             generate Comic Book CBZ File
174       -P --pdf              generate PDF file
175       --rm-origin-dir       remove downloaded doujinshi dir when generated CBZ
176                             or PDF file.
177
178       # nHentai options
179       --cookie=COOKIE       set cookie of nhentai to bypass Google recaptcha
180
181
182 ==============
183 nHentai Mirror
184 ==============
185 If you want to use a mirror, you should set up a reverse proxy of `nhentai.net` and `i.nhentai.net`.
186 For example:
187
188 .. code-block::
189
190     i.h.loli.club -> i.nhentai.net
191     h.loli.club -> nhentai.net
192
193 Set `NHENTAI` env var to your nhentai mirror.
194
195 .. code-block:: bash
196
197     NHENTAI=http://h.loli.club nhentai --id 123456
198
199
200 .. image:: ./images/search.png?raw=true
201     :alt: nhentai
202     :align: center
203 .. image:: ./images/download.png?raw=true
204     :alt: nhentai
205     :align: center
206 .. image:: ./images/viewer.png?raw=true
207     :alt: nhentai
208     :align: center
209
210 ============
211 あなたも変態
212 ============
213 .. image:: ./images/image.jpg?raw=true
214     :alt: nhentai
215     :align: center
216
217
218
219 .. |travis| image:: https://travis-ci.org/RicterZ/nhentai.svg?branch=master
220    :target: https://travis-ci.org/RicterZ/nhentai
221
222 .. |pypi| image:: https://img.shields.io/pypi/dm/nhentai.svg
223    :target: https://pypi.org/project/nhentai/
224
225 .. |license| image:: https://img.shields.io/github/license/ricterz/nhentai.svg
226    :target: https://github.com/RicterZ/nhentai/blob/master/LICENSE