]> git.lizzy.rs Git - nhentai.git/blob - README.rst
update README
[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 - %p: Doujinshi pretty name
125
126
127 Other options:
128
129 .. code-block::
130
131     Options:
132       # Operation options
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
136
137       # Doujinshi options
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.
143
144       # Multi-page options
145       --page=PAGE           page number of search results
146       --max-page=MAX_PAGE   The max page when recursive download tagged doujinshi
147
148       # Download options
149       -o OUTPUT_DIR, --output=OUTPUT_DIR
150                             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
161
162       # Generating options
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
169                             or PDF file.
170
171       # nHentai options
172       --cookie=COOKIE       set cookie of nhentai to bypass Google recaptcha
173
174
175 ==============
176 nHentai Mirror
177 ==============
178 If you want to use a mirror, you should set up a reverse proxy of `nhentai.net` and `i.nhentai.net`.
179 For example:
180
181 .. code-block::
182
183     i.h.loli.club -> i.nhentai.net
184     h.loli.club -> nhentai.net
185
186 Set `NHENTAI` env var to your nhentai mirror.
187
188 .. code-block:: bash
189
190     NHENTAI=http://h.loli.club nhentai --id 123456
191
192
193 .. image:: ./images/search.png?raw=true
194     :alt: nhentai
195     :align: center
196 .. image:: ./images/download.png?raw=true
197     :alt: nhentai
198     :align: center
199 .. image:: ./images/viewer.png?raw=true
200     :alt: nhentai
201     :align: center
202
203 ============
204 あなたも変態
205 ============
206 .. image:: ./images/image.jpg?raw=true
207     :alt: nhentai
208     :align: center
209
210
211
212 .. |travis| image:: https://travis-ci.org/RicterZ/nhentai.svg?branch=master
213    :target: https://travis-ci.org/RicterZ/nhentai
214
215 .. |pypi| image:: https://img.shields.io/pypi/dm/nhentai.svg
216    :target: https://pypi.org/project/nhentai/
217
218 .. |license| image:: https://img.shields.io/github/license/ricterz/nhentai.svg
219    :target: https://github.com/RicterZ/nhentai/blob/master/LICENSE