Skip to content

9-FS/2021-11-15-nHentai-to-PDF

Repository files navigation

Topic Author
nHentai to PDF
구FS

nHentai to PDF



1. General

This is the nHentai downloader I wrote to archive as much of the english nHentai library as I can. That's why from the beginning it has been designed with big data sizes in mind and, for example, uses multithreaded downloads to download more than 1 image at once. Still, I wanted to keep it as simple code-wise and as easy to use as I can; hope I succeeded with that.
Big thanks go out to h3nTa1m4st3r_xx69, who helped me using nhentai's completely undocumented API. Without him this project could not have been reactivated.
I'm happy about anyone who finds my software useful and feedback is also always welcome. Happy downloading~

2. How to Set Up

2.1. Firefox

  1. Execute the program once. This will create a default ./config/cookies.json.
  2. Go to https://nhentai.net/. Clear the cloudflare prompt.
  3. Open the developer console with F12.
  4. Go to the tab "Storage". On the left side expand "Cookies". Click on "https://nhentai.net".
  5. Copy the cookie values into the cookies.json.
  6. Execute the program again. This will create a default ./config/headers.json.
  7. Go to https://www.whatismybrowser.com/detect/what-is-my-user-agent/ and copy your user agent into headers.json.
  8. In ./config/settings.json set library_path to the directory you want to download to. By default, it will download to ./hentai/.
  9. In ./config/settings.json set library_split if you want to split your library into sub-directories. The number specifies the maximum number of hentai to allow per sub-directory. Set "0" if you want to disable splitting your library into sub-directories. It is disabled by default and only recommended if the number of hentai in 1 directory starts to affect file explorer performance. This should not affect you if you have 10.000 files or less in 1 directory.

2.2. Google Chrome

  1. Execute the program once. This will create a default ./config/cookies.json.
  2. Go to https://nhentai.net/. Clear the cloudflare prompt.
  3. Open the developer console with F12.
  4. Go to the tab "Application". On the left side under "Storage", expand "Cookies". Click on "https://nhentai.net".
  5. Copy the cookie values into the cookies.json.
  6. Execute the program again. This will create a default ./config/headers.json.
  7. Go to https://www.whatismybrowser.com/detect/what-is-my-user-agent/ and copy your user agent into headers.json.
  8. In ./config/settings.json set library_path to the directory you want to download to. By default, it will download to ./hentai/.
  9. In ./config/settings.json set library_split if you want to split your library into sub-directories. The number specifies the maximum number of hentai to allow per sub-directory. Set "0" if you want to disable splitting your library into sub-directories. It is disabled by default and only recommended if the number of hentai in 1 directory starts to affect file explorer performance. This should not affect you if you have 10.000 files or less in 1 directory.

ℹ️
Setting cookies seems to be required daily nowadays.

3. How to Use

Choose hentai by nHentai ID to download and convert to PDF. You can either load ID from a ./config/downloadme.txt seperated by linebreaks or directly enter ID into the console separated by spaces.