{"id":13714242,"url":"https://github.com/RicterZ/nhentai","last_synced_at":"2025-05-07T01:33:03.858Z","repository":{"id":30647534,"uuid":"34203126","full_name":"RicterZ/nhentai","owner":"RicterZ","description":"nhentai doujinshi downloader","archived":false,"fork":false,"pushed_at":"2024-05-21T05:39:27.000Z","size":6604,"stargazers_count":764,"open_issues_count":15,"forks_count":111,"subscribers_count":33,"default_branch":"master","last_synced_at":"2024-05-23T04:41:25.757Z","etag":null,"topics":["doujinshi","nhentai","python"],"latest_commit_sha":null,"homepage":"http://nhentai.net","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RicterZ.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-19T10:56:41.000Z","updated_at":"2024-06-19T11:14:02.386Z","dependencies_parsed_at":"2023-12-28T10:46:03.137Z","dependency_job_id":"846602de-389b-4dbd-b1be-cb583494ac6b","html_url":"https://github.com/RicterZ/nhentai","commit_stats":{"total_commits":453,"total_committers":35,"mean_commits":"12.942857142857143","dds":"0.29359823399558493","last_synced_commit":"f534b0b47f56f987d7b4a690a8155819f42b54e3"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RicterZ%2Fnhentai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RicterZ%2Fnhentai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RicterZ%2Fnhentai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RicterZ%2Fnhentai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RicterZ","download_url":"https://codeload.github.com/RicterZ/nhentai/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224551202,"owners_count":17330098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["doujinshi","nhentai","python"],"created_at":"2024-08-02T23:01:55.457Z","updated_at":"2025-05-07T01:33:03.848Z","avatar_url":"https://github.com/RicterZ.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"nhentai\n=======\n\nあなたも変態。 いいね?\n\n|travis|\n|pypi|\n|version|\n|license|\n\n\nnhentai is a CLI tool for downloading doujinshi from `nhentai.net \u003chttps://nhentai.net\u003e`_\n\nGUI version: `https://github.com/edgar1016/nhentai-GUI \u003chttps://github.com/edgar1016/nhentai-GUI\u003e`_\n\n===================\nManual Installation\n===================\nFrom Github:\n\n.. code-block::\n\n    git clone https://github.com/RicterZ/nhentai\n    cd nhentai\n    pip install --no-cache-dir .\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 \u003chttps://github.com/pipxproject/pipx/\u003e`_:\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 glibOne\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**⚠️IMPORTANT⚠️**: 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 --page 3-5,7\n\nFormat output doujinshi folder name:\n\n.. code-block:: bash\n\n    nhentai --id 261100 --format '[%i]%s'\n    # for Windows\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\nNote: for Windows operation system, please use double \"%\", such as \"%%i\".\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      --retry=RETRY         retry times when downloading failed\n      --exit-on-fail        exit on fail to prevent generating incomplete files\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 -\u003e i.nhentai.net\n    i3.h.loli.club -\u003e i3.nhentai.net\n    i5.h.loli.club -\u003e i5.nhentai.net\n    i7.h.loli.club -\u003e i7.nhentai.net\n    h.loli.club -\u003e 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRicterZ%2Fnhentai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRicterZ%2Fnhentai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRicterZ%2Fnhentai/lists"}