nhentai
=======
あなたも変態。 いいね?
|travis|
|pypi|
|version|
|license|
nhentai is a CLI tool for downloading doujinshi from `nhentai.net <https://nhentai.net>`_
GUI version: `https://github.com/edgar1016/nhentai-GUI <https://github.com/edgar1016/nhentai-GUI>`_
===================
Manual Installation
===================
From Github:
.. code-block::
git clone https://github.com/RicterZ/nhentai
cd nhentai
python setup.py install
Build Docker container:
.. code-block::
git clone https://github.com/RicterZ/nhentai
cd nhentai
docker build -t nhentai:latest .
docker run --rm -it -v ~/Downloads/doujinshi:/output -v ~/.nhentai/:/root/.nhentai nhentai --id 123855
==================
Installation
==================
From PyPI with pip:
.. code-block::
pip install nhentai
For a self-contained installation, use `pipx <https://github.com/pipxproject/pipx/>`_:
.. code-block::
pipx install nhentai
Pull from Dockerhub:
.. code-block::
docker pull ricterz/nhentai
docker run --rm -it -v ~/Downloads/doujinshi:/output -v ~/.nhentai/:/root/.nhentai ricterz/nhentai --id 123855
On Gentoo Linux:
.. code-block::
layman -fa glicOne
sudo emerge net-misc/nhentai
On NixOS:
.. code-block::
nix-env -iA nixos.nhentai
=====
Usage
=====
**⚠️IMPORTANT⚠️**: To bypass the nhentai frequency limit, you should use `--cookie` and `--useragent` options to store your cookie and your user-agent.
.. code-block:: bash
nhentai --useragent "USER AGENT of YOUR BROWSER"
nhentai --cookie "YOUR COOKIE FROM nhentai.net"
**NOTE:**
- The format of the cookie is `"csrftoken=TOKEN; sessionid=ID; cf_clearance=CLOUDFLARE"`
- `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
| To get csrftoken and sessionid, first login to your nhentai account in web browser, then:
| (Chrome) |ve| |ld| More tools |ld| Developer tools |ld| Application |ld| Storage |ld| Cookies |ld| https://nhentai.net
| (Firefox) |hv| |ld| Web Developer |ld| Web Developer Tools |ld| Storage |ld| Cookies |ld| https://nhentai.net
|
.. |hv| unicode:: U+2630 .. https://www.compart.com/en/unicode/U+2630
.. |ve| unicode:: U+22EE .. https://www.compart.com/en/unicode/U+22EE
.. |ld| unicode:: U+2014 .. https://www.compart.com/en/unicode/U+2014
.. image:: https://github.com/RicterZ/nhentai/raw/master/images/usage.png
:alt: nhentai
:align: center
*The default download folder will be the path where you run the command (%cd% or $PWD).*
Download specified doujinshi:
.. code-block:: bash
nhentai --id 123855 123866 123877
Download doujinshi with ids specified in a file (doujinshi ids split by line):
.. code-block:: bash
nhentai --file=doujinshi.txt
Set search default language
.. code-block:: bash
nhentai --language=english
Search a keyword and download the first page:
.. code-block:: bash
nhentai --search="tomori" --page=1 --download
# you also can download by tags and multiple keywords
nhentai --search="tag:lolicon, artist:henreader, tag:full color"
nhentai --search="lolicon, henreader, full color"
Download your favorites with delay:
.. code-block:: bash
nhentai --favorites --download --delay 1
Format output doujinshi folder name:
.. code-block:: bash
nhentai --id 261100 --format '[%i]%s'
Supported doujinshi folder formatter:
- %i: Doujinshi id
- %f: Doujinshi favorite count
- %t: Doujinshi name
- %s: Doujinshi subtitle (translated name)
- %a: Doujinshi authors' name
- %g: Doujinshi groups name
- %p: Doujinshi pretty name
- %ag: Doujinshi authors name or groups name
Other options:
.. code-block::
Usage:
nhentai --search [keyword] --download
NHENTAI=https://nhentai-mirror-url/ nhentai --id [ID ...]
nhentai --file [filename]
Environment Variable:
NHENTAI nhentai mirror url
Options:
-h, --help show this help message and exit
-D, --download download doujinshi (for search results)
-S, --show just show the doujinshi information
--id doujinshi ids set, e.g. 167680 167681 167682
-s KEYWORD, --search=KEYWORD
search doujinshi by keyword
-F, --favorites list or download your favorites
-a ARTIST, --artist=ARTIST
list doujinshi by artist name
--page-all all search results
--page=PAGE, --page-range=PAGE
page number of search results. e.g. 1,2-5,14
--sorting=SORTING, --sort=SORTING
sorting of doujinshi (recent / popular /
popular-[today|week])
-o OUTPUT_DIR, --output=OUTPUT_DIR
output dir
-t THREADS, --threads=THREADS
thread count for downloading doujinshi
-T TIMEOUT, --timeout=TIMEOUT
timeout for downloading doujinshi
-d DELAY, --delay=DELAY
slow down between downloading every doujinshi
--proxy=PROXY store a proxy, for example: -p "http://127.0.0.1:1080"
-f FILE, --file=FILE read gallery IDs from file.
--format=NAME_FORMAT format the saved folder name
--dry-run Dry run, skip file download
--html generate a html viewer at current directory
--no-html don't generate HTML after downloading
--gen-main generate a main viewer contain all the doujin in the
folder
-C, --cbz generate Comic Book CBZ File
-P, --pdf generate PDF file
--rm-origin-dir remove downloaded doujinshi dir when generated CBZ or
PDF file
--move-to-folder remove files in doujinshi dir then move new file to
folder when generated CBZ or PDF file
--meta generate a metadata file in doujinshi format
--regenerate regenerate the cbz or pdf file if exists
--cookie=COOKIE set cookie of nhentai to bypass Cloudflare captcha
--useragent=USERAGENT, --user-agent=USERAGENT
set useragent to bypass Cloudflare captcha
--language=LANGUAGE set default language to parse doujinshis
--clean-language set DEFAULT as language to parse doujinshis
--save-download-history
save downloaded doujinshis, whose will be skipped if
you re-download them
--clean-download-history
clean download history
--template=VIEWER_TEMPLATE
set viewer template
--legacy use legacy searching method
==============
nHentai Mirror
==============
If you want to use a mirror, you should set up a reverse proxy of `nhentai.net` and `i.nhentai.net`.
For example:
.. code-block::
i.h.loli.club -> i.nhentai.net
i3.h.loli.club -> i3.nhentai.net
i5.h.loli.club -> i5.nhentai.net
i7.h.loli.club -> i7.nhentai.net
h.loli.club -> nhentai.net
Set `NHENTAI` env var to your nhentai mirror.
.. code-block:: bash
NHENTAI=https://h.loli.club nhentai --id 123456
.. image:: https://github.com/RicterZ/nhentai/raw/master/images/search.png
:alt: nhentai
:align: center
.. image:: https://github.com/RicterZ/nhentai/raw/master/images/download.png
:alt: nhentai
:align: center
.. image:: https://github.com/RicterZ/nhentai/raw/master/images/viewer.png
:alt: nhentai
:align: center
.. |travis| image:: https://travis-ci.org/RicterZ/nhentai.svg?branch=master
:target: https://travis-ci.org/RicterZ/nhentai
.. |pypi| image:: https://img.shields.io/pypi/dm/nhentai.svg
:target: https://pypi.org/project/nhentai/
.. |version| image:: https://img.shields.io/pypi/v/nhentai
:target: https://pypi.org/project/nhentai/
.. |license| image:: https://img.shields.io/github/license/ricterz/nhentai.svg
:target: https://github.com/RicterZ/nhentai/blob/master/LICENSE
Raw data
{
"_id": null,
"home_page": "https://github.com/RicterZ/nhentai",
"name": "nhentai",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "nhentai, doujinshi, downloader",
"author": "RicterZ",
"author_email": "ricterzheng@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/1b/92/c9cd70ad341cbc2a37b4da359cb6666abb89868585b41b8f0333cdab5cc5/nhentai-0.5.17.tar.gz",
"platform": null,
"description": "nhentai\n=======\n\n\u3042\u306a\u305f\u3082\u5909\u614b\u3002 \u3044\u3044\u306d?\n\n|travis|\n|pypi|\n|version|\n|license|\n\n\nnhentai is a CLI tool for downloading doujinshi from `nhentai.net <https://nhentai.net>`_\n\nGUI version: `https://github.com/edgar1016/nhentai-GUI <https://github.com/edgar1016/nhentai-GUI>`_\n\n===================\nManual Installation\n===================\nFrom Github:\n\n.. code-block::\n\n git clone https://github.com/RicterZ/nhentai\n cd nhentai\n python setup.py install\n\nBuild Docker container:\n\n.. code-block::\n\n git clone https://github.com/RicterZ/nhentai\n cd nhentai\n docker build -t nhentai:latest .\n docker run --rm -it -v ~/Downloads/doujinshi:/output -v ~/.nhentai/:/root/.nhentai nhentai --id 123855\n\n==================\nInstallation\n==================\nFrom PyPI with pip:\n\n.. code-block::\n\n pip install nhentai\n\nFor a self-contained installation, use `pipx <https://github.com/pipxproject/pipx/>`_:\n\n.. code-block::\n\n pipx install nhentai\n\nPull from Dockerhub:\n\n.. code-block::\n\n docker pull ricterz/nhentai\n docker run --rm -it -v ~/Downloads/doujinshi:/output -v ~/.nhentai/:/root/.nhentai ricterz/nhentai --id 123855\n\nOn Gentoo Linux:\n\n.. code-block::\n\n layman -fa glicOne\n sudo emerge net-misc/nhentai\n\nOn NixOS:\n\n.. code-block::\n\n nix-env -iA nixos.nhentai\n \n=====\nUsage\n=====\n**\u26a0\ufe0fIMPORTANT\u26a0\ufe0f**: To bypass the nhentai frequency limit, you should use `--cookie` and `--useragent` options to store your cookie and your user-agent.\n\n.. code-block:: bash\n\n nhentai --useragent \"USER AGENT of YOUR BROWSER\"\n nhentai --cookie \"YOUR COOKIE FROM nhentai.net\"\n\n**NOTE:**\n\n- The format of the cookie is `\"csrftoken=TOKEN; sessionid=ID; cf_clearance=CLOUDFLARE\"`\n- `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\n\n| To get csrftoken and sessionid, first login to your nhentai account in web browser, then:\n| (Chrome) |ve| |ld| More tools |ld| Developer tools |ld| Application |ld| Storage |ld| Cookies |ld| https://nhentai.net\n| (Firefox) |hv| |ld| Web Developer |ld| Web Developer Tools |ld| Storage |ld| Cookies |ld| https://nhentai.net\n| \n\n.. |hv| unicode:: U+2630 .. https://www.compart.com/en/unicode/U+2630\n.. |ve| unicode:: U+22EE .. https://www.compart.com/en/unicode/U+22EE\n.. |ld| unicode:: U+2014 .. https://www.compart.com/en/unicode/U+2014\n\n.. image:: https://github.com/RicterZ/nhentai/raw/master/images/usage.png\n :alt: nhentai\n :align: center\n\n*The default download folder will be the path where you run the command (%cd% or $PWD).*\n\nDownload specified doujinshi:\n\n.. code-block:: bash\n\n nhentai --id 123855 123866 123877\n\nDownload doujinshi with ids specified in a file (doujinshi ids split by line):\n\n.. code-block:: bash\n\n nhentai --file=doujinshi.txt\n\nSet search default language\n\n.. code-block:: bash\n\n nhentai --language=english\n\nSearch a keyword and download the first page:\n\n.. code-block:: bash\n\n nhentai --search=\"tomori\" --page=1 --download\n # you also can download by tags and multiple keywords\n nhentai --search=\"tag:lolicon, artist:henreader, tag:full color\"\n nhentai --search=\"lolicon, henreader, full color\"\n\nDownload your favorites with delay:\n\n.. code-block:: bash\n\n nhentai --favorites --download --delay 1\n\nFormat output doujinshi folder name:\n\n.. code-block:: bash\n\n nhentai --id 261100 --format '[%i]%s'\n\nSupported doujinshi folder formatter:\n\n- %i: Doujinshi id\n- %f: Doujinshi favorite count\n- %t: Doujinshi name\n- %s: Doujinshi subtitle (translated name)\n- %a: Doujinshi authors' name\n- %g: Doujinshi groups name\n- %p: Doujinshi pretty name\n- %ag: Doujinshi authors name or groups name\n\n\nOther options:\n\n.. code-block::\n\n Usage:\n nhentai --search [keyword] --download\n NHENTAI=https://nhentai-mirror-url/ nhentai --id [ID ...]\n nhentai --file [filename]\n\n Environment Variable:\n NHENTAI nhentai mirror url\n\n Options:\n -h, --help show this help message and exit\n -D, --download download doujinshi (for search results)\n -S, --show just show the doujinshi information\n --id doujinshi ids set, e.g. 167680 167681 167682\n -s KEYWORD, --search=KEYWORD\n search doujinshi by keyword\n -F, --favorites list or download your favorites\n -a ARTIST, --artist=ARTIST\n list doujinshi by artist name\n --page-all all search results\n --page=PAGE, --page-range=PAGE\n page number of search results. e.g. 1,2-5,14\n --sorting=SORTING, --sort=SORTING\n sorting of doujinshi (recent / popular /\n popular-[today|week])\n -o OUTPUT_DIR, --output=OUTPUT_DIR\n output dir\n -t THREADS, --threads=THREADS\n thread count for downloading doujinshi\n -T TIMEOUT, --timeout=TIMEOUT\n timeout for downloading doujinshi\n -d DELAY, --delay=DELAY\n slow down between downloading every doujinshi\n --proxy=PROXY store a proxy, for example: -p \"http://127.0.0.1:1080\"\n -f FILE, --file=FILE read gallery IDs from file.\n --format=NAME_FORMAT format the saved folder name\n --dry-run Dry run, skip file download\n --html generate a html viewer at current directory\n --no-html don't generate HTML after downloading\n --gen-main generate a main viewer contain all the doujin in the\n folder\n -C, --cbz generate Comic Book CBZ File\n -P, --pdf generate PDF file\n --rm-origin-dir remove downloaded doujinshi dir when generated CBZ or\n PDF file\n --move-to-folder remove files in doujinshi dir then move new file to\n folder when generated CBZ or PDF file\n --meta generate a metadata file in doujinshi format\n --regenerate regenerate the cbz or pdf file if exists\n --cookie=COOKIE set cookie of nhentai to bypass Cloudflare captcha\n --useragent=USERAGENT, --user-agent=USERAGENT\n set useragent to bypass Cloudflare captcha\n --language=LANGUAGE set default language to parse doujinshis\n --clean-language set DEFAULT as language to parse doujinshis\n --save-download-history\n save downloaded doujinshis, whose will be skipped if\n you re-download them\n --clean-download-history\n clean download history\n --template=VIEWER_TEMPLATE\n set viewer template\n --legacy use legacy searching method\n\n==============\nnHentai Mirror\n==============\nIf you want to use a mirror, you should set up a reverse proxy of `nhentai.net` and `i.nhentai.net`.\nFor example:\n\n.. code-block::\n\n i.h.loli.club -> i.nhentai.net\n i3.h.loli.club -> i3.nhentai.net\n i5.h.loli.club -> i5.nhentai.net\n i7.h.loli.club -> i7.nhentai.net\n h.loli.club -> nhentai.net\n\nSet `NHENTAI` env var to your nhentai mirror.\n\n.. code-block:: bash\n\n NHENTAI=https://h.loli.club nhentai --id 123456\n\n\n.. image:: https://github.com/RicterZ/nhentai/raw/master/images/search.png\n :alt: nhentai\n :align: center\n.. image:: https://github.com/RicterZ/nhentai/raw/master/images/download.png\n :alt: nhentai\n :align: center\n.. image:: https://github.com/RicterZ/nhentai/raw/master/images/viewer.png\n :alt: nhentai\n :align: center\n\n\n.. |travis| image:: https://travis-ci.org/RicterZ/nhentai.svg?branch=master\n :target: https://travis-ci.org/RicterZ/nhentai\n\n.. |pypi| image:: https://img.shields.io/pypi/dm/nhentai.svg\n :target: https://pypi.org/project/nhentai/\n\n.. |version| image:: https://img.shields.io/pypi/v/nhentai\n :target: https://pypi.org/project/nhentai/\n\n.. |license| image:: https://img.shields.io/github/license/ricterz/nhentai.svg\n :target: https://github.com/RicterZ/nhentai/blob/master/LICENSE\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "nhentai.net doujinshis downloader",
"version": "0.5.17",
"project_urls": {
"Download": "https://github.com/RicterZ/nhentai/tarball/master",
"Homepage": "https://github.com/RicterZ/nhentai"
},
"split_keywords": [
"nhentai",
" doujinshi",
" downloader"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1b92c9cd70ad341cbc2a37b4da359cb6666abb89868585b41b8f0333cdab5cc5",
"md5": "bac78c501ee067ed3364ee29d0474a05",
"sha256": "f3c0784f873ff584379acc6f80315aecdff527c718095072d2715817cfb47def"
},
"downloads": -1,
"filename": "nhentai-0.5.17.tar.gz",
"has_sig": false,
"md5_digest": "bac78c501ee067ed3364ee29d0474a05",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 44380,
"upload_time": "2024-12-09T01:27:55",
"upload_time_iso_8601": "2024-12-09T01:27:55.759035Z",
"url": "https://files.pythonhosted.org/packages/1b/92/c9cd70ad341cbc2a37b4da359cb6666abb89868585b41b8f0333cdab5cc5/nhentai-0.5.17.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-09 01:27:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "RicterZ",
"github_project": "nhentai",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "httpx",
"specs": [
[
"==",
"0.27.2"
]
]
},
{
"name": "requests",
"specs": []
},
{
"name": "soupsieve",
"specs": []
},
{
"name": "setuptools",
"specs": []
},
{
"name": "BeautifulSoup4",
"specs": []
},
{
"name": "tabulate",
"specs": []
},
{
"name": "iso8601",
"specs": []
},
{
"name": "urllib3",
"specs": []
}
],
"lcname": "nhentai"
}