]> git.lizzy.rs Git - nhentai.git/blob - README.rst
undo whitespace edits
[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 Usage
56 =====
57 **IMPORTANT**: To bypass the nhentai frequency limit, you should use `--cookie` option to store your cookie.
58
59 *The default download folder will be the path where you run the command (CLI path).*
60
61
62 Set your nhentai cookie against captcha:
63
64 .. code-block:: bash
65
66     nhentai --cookie "YOUR COOKIE FROM nhentai.net"
67
68 **NOTE**: The format of the cookie is `"csrftoken=TOKEN; sessionid=ID"`
69
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
73
74
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
78
79 Download specified doujinshi:
80
81 .. code-block:: bash
82
83     nhentai --id=123855,123866
84
85 Download doujinshi with ids specified in a file (doujinshi ids split by line):
86
87 .. code-block:: bash
88
89     nhentai --file=doujinshi.txt
90
91 Set search default language
92
93 .. code-block:: bash
94
95     nhentai --language=english
96
97 Search a keyword and download the first page:
98
99 .. code-block:: bash
100
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"
105
106 Download your favorites with delay:
107
108 .. code-block:: bash
109
110     nhentai --favorites --download --delay 1
111
112 Format output doujinshi folder name:
113
114 .. code-block:: bash
115
116     nhentai --id 261100 --format '[%i]%s'
117
118 Supported doujinshi folder formatter:
119
120 - %i: Doujinshi id
121 - %t: Doujinshi name
122 - %s: Doujinshi subtitle (translated name)
123 - %a: Doujinshi authors' name
124
125
126 Other options:
127
128 .. code-block::
129
130     Options:
131       # Operation options
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
135
136       # Doujinshi options
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.
142
143       # Multi-page options
144       --page=PAGE           page number of search results
145       --max-page=MAX_PAGE   The max page when recursive download tagged doujinshi
146
147       # Download options
148       -o OUTPUT_DIR, --output=OUTPUT_DIR
149                             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
160
161       # Generating options
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
168                             or PDF file.
169
170       # nHentai options
171       --cookie=COOKIE       set cookie of nhentai to bypass Google recaptcha
172
173
174 ==============
175 nHentai Mirror
176 ==============
177 If you want to use a mirror, you should set up a reverse proxy of `nhentai.net` and `i.nhentai.net`.
178 For example:
179
180 .. code-block::
181
182     i.h.loli.club -> i.nhentai.net
183     h.loli.club -> nhentai.net
184
185 Set `NHENTAI` env var to your nhentai mirror.
186
187 .. code-block:: bash
188
189     NHENTAI=http://h.loli.club nhentai --id 123456
190
191
192 .. image:: ./images/search.png?raw=true
193     :alt: nhentai
194     :align: center
195 .. image:: ./images/download.png?raw=true
196     :alt: nhentai
197     :align: center
198 .. image:: ./images/viewer.png?raw=true
199     :alt: nhentai
200     :align: center
201
202 ============
203 あなたも変態
204 ============
205 .. image:: ./images/image.jpg?raw=true
206     :alt: nhentai
207     :align: center
208
209
210
211 .. |travis| image:: https://travis-ci.org/RicterZ/nhentai.svg?branch=master
212    :target: https://travis-ci.org/RicterZ/nhentai
213
214 .. |pypi| image:: https://img.shields.io/pypi/dm/nhentai.svg
215    :target: https://pypi.org/project/nhentai/
216
217 .. |license| image:: https://img.shields.io/github/license/ricterz/nhentai.svg
218    :target: https://github.com/RicterZ/nhentai/blob/master/LICENSE