A simple usercript for downloading galleries from NHentai and mirrors
Userscript to download galleries from NHentai. It has features to be used with konnichiwa. NHentai started using Cloudflare protection and now you can't reliably download hentai with the download tab in konnichiwa. To make things easier for yourself if you use konnichiwa, you could use this userscript.
If you don't use konnichiwa, you can still use this without losing any functionality.
This script downloads a single zip file with separate directories for all selected galleries inside it. The name of the zip file is the number of milliseconds since January 1, 1970.
Supports only Tampermonkey and Violentmonkey.
For using with konnichiwa, extract the zip file, move the json file to the
scripts/modification
directory and run the command:
php refresh_db.php [JSON-FILE-NAME]
This adds all the data to the database. Now move the downloaded directories to your holy directory.
On the individual gallery page.
On the homepage, search and similar pages.
On the recommendations section.
-
Download button: Download all selected galleries. The Download button changes state depending on the stage of download. If the data is being
If the data is being `downloaded`, it looks like this: If the data is being `compressed`, it looks like this:fetched
, it looks like this: -
Config button: Change configuration options.
-
Check-all checkbox: Select all galleries on the page. Note: Since there are checkboxes on the recommendation ("More like this") section, if you check this on a gallery page, it's recommendations will get selected as well.
-
Download batch size: Number of downloads to run simultaneously.
- Minimum: 1
- Maximum: 50
Default is 10. If you make it too high, a lot of downloads will fail.
-
Compression Level: The level of compression for the final zip.
- Minumum: 0 (No compression. Fastest.)
- Maximum: 9 (Maximum compression. Slowest.)
-
Title format: The galleries are downloaded in their own separate directories. This option is for specifying the name of those directories. There are four available options:
- pretty
default
- english
- japanese
- id
- pretty
-
Filename to prepend: The text that gets added before every filename. If no value is specified, The default filename is
{page}.{ext}
. -
Filename separator: The character to put between given filename (if any) and
{page}
. So, if this value is set toUnderscore
and the filename is set tomyFileName
, the files will be saved asmyFileName_{page}.{ext}
. The symbols/
,\
,|
,:
and;
will also be replaced by this separator, both in the title and theFilename to prepend
text provided. There are three available options:- Space
default
- Hyphen
- Underscore
- Space
-
Save JSON: This is mainly for use with konnichiwa. This outputs a file in the format specified here. There are three available options:
- Don't save
default
- Save as JSON file
- Copy to clipboard
Save as JSON file will save the content to a file with the same name as the zip file. You can then run
refresh_db.php
script from konnichiwa on this file to add all the downloaded galleries to your database. - Don't save
-
Include groups in authors: If the Save JSON option is set, the output has a key
authors
. This decides if the 'Groups' in NHentai metadata will be added to its value. -
Button orientation: The three buttons (download, config and check-all) are by default aligned vertically. But if you want you can change this. There are two available options:
- Vertical
default
- Horizontal
- Vertical
-
Open galleries in new tab: Galleries are opened in new tab by default. You can turn this off if you want. But as a result, you will be prompted for confirmation if you click on a gallery link.
-
Auto restart downloads: Downlads are automatically restarted on page change by default. You can turn this off if you want.
-
Cancel downloads: You can choose to cancel ongoing downloads by clicking this.
Ongoing downloads will restart if you change the page. You can, of course, turn this off. It's still recommended to stay on the page while a download is ongoing.
- nhentai.net
- nhentai.xxx
- nyahentai.red
- nhentai.to
- nhentai.website