]> git.lizzy.rs Git - nhentai.git/blob - README.rst
0604f937e644c8fc43dff30bceff472f4d9133ed
[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**
76
77 - The format of the cookie is `"csrftoken=TOKEN; sessionid=ID; cf_clearance=CLOUDFLARE"`
78 - `cf_clearance` cookie and useragent must be set if you encounter "blocked by cloudflare captcha" error. Make sure you use the same IP and useragent as when you got it
79
80 | To get csrftoken and sessionid, first login to your nhentai account in web browser, then:
81 | (Chrome) |ve| |ld| More tools    |ld| Developer tools     |ld| Application |ld| Storage |ld| Cookies |ld| https://nhentai.net
82 | (Firefox) |hv| |ld| Web Developer |ld| Web Developer Tools                  |ld| Storage |ld| Cookies |ld| https://nhentai.net
83
84
85 .. |hv| unicode:: U+2630 .. https://www.compart.com/en/unicode/U+2630
86 .. |ve| unicode:: U+22EE .. https://www.compart.com/en/unicode/U+22EE
87 .. |ld| unicode:: U+2014 .. https://www.compart.com/en/unicode/U+2014
88
89 Download specified doujinshi:
90
91 .. code-block:: bash
92
93     nhentai --id=123855,123866
94
95 Download doujinshi with ids specified in a file (doujinshi ids split by line):
96
97 .. code-block:: bash
98
99     nhentai --file=doujinshi.txt
100
101 Set search default language
102
103 .. code-block:: bash
104
105     nhentai --language=english
106
107 Search a keyword and download the first page:
108
109 .. code-block:: bash
110
111     nhentai --search="tomori" --page=1 --download
112     # you also can download by tags and multiple keywords
113     nhentai --search="tag:lolicon, artist:henreader, tag:full color"
114     nhentai --search="lolicon, henreader, full color"
115
116 Download your favorites with delay:
117
118 .. code-block:: bash
119
120     nhentai --favorites --download --delay 1
121
122 Format output doujinshi folder name:
123
124 .. code-block:: bash
125
126     nhentai --id 261100 --format '[%i]%s'
127
128 Supported doujinshi folder formatter:
129
130 - %i: Doujinshi id
131 - %t: Doujinshi name
132 - %s: Doujinshi subtitle (translated name)
133 - %a: Doujinshi authors' name
134 - %p: Doujinshi pretty name
135
136
137 Other options:
138
139 .. code-block::
140
141     Usage:
142       nhentai --search [keyword] --download
143       NHENTAI=http://h.loli.club nhentai --id [ID ...]
144       nhentai --file [filename]
145
146     Environment Variable:
147       NHENTAI                 nhentai mirror url
148
149     Options:
150       -h, --help            show this help message and exit
151       -D, --download        download doujinshi (for search results)
152       -S, --show            just show the doujinshi information
153       --id=ID               doujinshi ids set, e.g. 1,2,3
154       -s KEYWORD, --search=KEYWORD
155                             search doujinshi by keyword
156       -F, --favorites       list or download your favorites.
157       --page-all            all search results
158       --page=PAGE, --page-range=PAGE
159                             page number of search results. e.g. 1,2-5,14
160       --sorting=SORTING     sorting of doujinshi (recent / popular /
161                             popular-[today|week])
162       -o OUTPUT_DIR, --output=OUTPUT_DIR
163                             output dir
164       -t THREADS, --threads=THREADS
165                             thread count for downloading doujinshi
166       -T TIMEOUT, --timeout=TIMEOUT
167                             timeout for downloading doujinshi
168       -d DELAY, --delay=DELAY
169                             slow down between downloading every doujinshi
170       --proxy=PROXY         store a proxy, for example: -p 'http://127.0.0.1:1080'
171       -f FILE, --file=FILE  read gallery IDs from file.
172       --format=NAME_FORMAT  format the saved folder name
173       -r, --dry-run         Dry run, skip file download.
174       --html                generate a html viewer at current directory
175       --no-html             don't generate HTML after downloading
176       --gen-main            generate a main viewer contain all the doujin in the
177                             folder
178       -C, --cbz             generate Comic Book CBZ File
179       -P, --pdf             generate PDF file
180       --rm-origin-dir       remove downloaded doujinshi dir when generated CBZ or
181                             PDF file.
182       --meta                generate a metadata file in doujinshi format
183       --regenerate-cbz      regenerate the cbz file if exists
184       --cookie=COOKIE       set cookie of nhentai to bypass Cloudflare captcha
185       --useragent=USERAGENT
186                             set useragent to bypass Cloudflare captcha
187       --language=LANGUAGE   set default language to parse doujinshis
188       --clean-language      set DEFAULT as language to parse doujinshis
189       --save-download-history
190                             save downloaded doujinshis, whose will be skipped if
191                             you re-download them
192       --clean-download-history
193                             clean download history
194       --template=VIEWER_TEMPLATE
195                             set viewer template
196
197 ==============
198 nHentai Mirror
199 ==============
200 If you want to use a mirror, you should set up a reverse proxy of `nhentai.net` and `i.nhentai.net`.
201 For example:
202
203 .. code-block::
204
205     i.h.loli.club -> i.nhentai.net
206     h.loli.club -> nhentai.net
207
208 Set `NHENTAI` env var to your nhentai mirror.
209
210 .. code-block:: bash
211
212     NHENTAI=http://h.loli.club nhentai --id 123456
213
214
215 .. image:: ./images/search.png?raw=true
216     :alt: nhentai
217     :align: center
218 .. image:: ./images/download.png?raw=true
219     :alt: nhentai
220     :align: center
221 .. image:: ./images/viewer.png?raw=true
222     :alt: nhentai
223     :align: center
224
225
226
227 .. |travis| image:: https://travis-ci.org/RicterZ/nhentai.svg?branch=master
228    :target: https://travis-ci.org/RicterZ/nhentai
229
230 .. |pypi| image:: https://img.shields.io/pypi/dm/nhentai.svg
231    :target: https://pypi.org/project/nhentai/
232
233 .. |license| image:: https://img.shields.io/github/license/ricterz/nhentai.svg
234    :target: https://github.com/RicterZ/nhentai/blob/master/LICENSE