nhentai


Namenhentai JSON
Version 0.5.2 PyPI version JSON
download
home_pagehttps://github.com/RicterZ/nhentai
Summarynhentai.net doujinshis downloader
upload_time2023-02-05 16:04:22
maintainer
docs_urlNone
authorRicterZ
requires_python
licenseMIT
keywords nhentai doujinshi downloader
VCS
bugtrack_url
requirements requests soupsieve BeautifulSoup4 tabulate iso8601 urllib3
Travis-CI
coveralls test coverage No coveralls.
            nhentai
=======

あなたも変態。 いいね?

|travis|
|pypi|
|version|
|license|


nHentai is a CLI tool for downloading doujinshi from <http://nhentai.net>

===================
Manual Installation
===================
.. code-block::

    git clone https://github.com/RicterZ/nhentai
    cd nhentai
    python setup.py install

==================
Installation (pip)
==================
Alternatively, install 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

=====================
Installation (Gentoo)
=====================
.. code-block::

    layman -fa glicOne
    sudo emerge net-misc/nhentai
    
=====================
Installation (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.

*The default download folder will be the path where you run the command (CLI path).*


Set your nhentai cookie against captcha:

.. 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

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
- %t: Doujinshi name
- %s: Doujinshi subtitle (translated name)
- %a: Doujinshi authors' name
- %p: Doujinshi pretty 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:
      # Operation options, control the program behaviors
      -h, --help            show this help message and exit
      -D, --download        download doujinshi (for search results)
      -S, --show            just show the doujinshi information

      # Doujinshi options, specify id, keyword, etc.
      --id                  doujinshi ids set, e.g. 167680 167681 167682
      -s KEYWORD, --search=KEYWORD
                            search doujinshi by keyword
      -F, --favorites       list or download your favorites

      # Page options, control the page to fetch / download
      --page-all            all search results
      --page=PAGE, --page-range=PAGE
                            page number of search results. e.g. 1,2-5,14
      --sorting=SORTING     sorting of doujinshi (recent / popular /
                            popular-[today|week])

      # Download options, the output directory, threads, timeout, delay, etc.
      -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

      # Generate options, for generate html viewer, cbz file, pdf file, etc
      --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
      --meta                generate a metadata file in doujinshi format
      --regenerate-cbz      regenerate the cbz file if exists

      # nhentai options, set cookie, user-agent, language, remove caches, histories, etc
      --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
    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": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "nhentai,doujinshi,downloader",
    "author": "RicterZ",
    "author_email": "ricterzheng@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/12/6b/1b7372166547fc61005a7f6fea27a6dbbee2ad5a2c7393ead3c5410f4fdd/nhentai-0.5.2.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 <http://nhentai.net>\n\n===================\nManual Installation\n===================\n.. code-block::\n\n    git clone https://github.com/RicterZ/nhentai\n    cd nhentai\n    python setup.py install\n\n==================\nInstallation (pip)\n==================\nAlternatively, install from 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\n=====================\nInstallation (Gentoo)\n=====================\n.. code-block::\n\n    layman -fa glicOne\n    sudo emerge net-misc/nhentai\n    \n=====================\nInstallation (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*The default download folder will be the path where you run the command (CLI path).*\n\n\nSet your nhentai cookie against captcha:\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\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- %t: Doujinshi name\n- %s: Doujinshi subtitle (translated name)\n- %a: Doujinshi authors' name\n- %p: Doujinshi pretty 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      # Operation options, control the program behaviors\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\n      # Doujinshi options, specify id, keyword, etc.\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\n      # Page options, control the page to fetch / download\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     sorting of doujinshi (recent / popular /\n                            popular-[today|week])\n\n      # Download options, the output directory, threads, timeout, delay, etc.\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\n      # Generate options, for generate html viewer, cbz file, pdf file, etc\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      --meta                generate a metadata file in doujinshi format\n      --regenerate-cbz      regenerate the cbz file if exists\n\n      # nhentai options, set cookie, user-agent, language, remove caches, histories, etc\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    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.2",
    "split_keywords": [
        "nhentai",
        "doujinshi",
        "downloader"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "126b1b7372166547fc61005a7f6fea27a6dbbee2ad5a2c7393ead3c5410f4fdd",
                "md5": "0e703cde3daf11d5da6d38cb2e695229",
                "sha256": "6bfd9401ced4fb37bdb1943648167e7f6aa9bb2936f353b92b05065ef026d928"
            },
            "downloads": -1,
            "filename": "nhentai-0.5.2.tar.gz",
            "has_sig": false,
            "md5_digest": "0e703cde3daf11d5da6d38cb2e695229",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 41363,
            "upload_time": "2023-02-05T16:04:22",
            "upload_time_iso_8601": "2023-02-05T16:04:22.284786Z",
            "url": "https://files.pythonhosted.org/packages/12/6b/1b7372166547fc61005a7f6fea27a6dbbee2ad5a2c7393ead3c5410f4fdd/nhentai-0.5.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-05 16:04:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "RicterZ",
    "github_project": "nhentai",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.5.0"
                ]
            ]
        },
        {
            "name": "soupsieve",
            "specs": []
        },
        {
            "name": "BeautifulSoup4",
            "specs": [
                [
                    ">=",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "tabulate",
            "specs": [
                [
                    ">=",
                    "0.7.5"
                ]
            ]
        },
        {
            "name": "iso8601",
            "specs": [
                [
                    ">=",
                    "0.1"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": []
        }
    ],
    "lcname": "nhentai"
}
        
Elapsed time: 0.03814s