Home

Awesome

E-Hentai-Downloader

Download E-Hentai archive as zip file :package:

Required Environment

BrowserGreaseMonkeyTampermonkeyViolentmonkey
Firefox (56-)3.2 beta2+
Firefox (57+)4.1 beta5+4.0.5054+2.8.18+
Chrome3.5.3630+2.2.6+
Opera (15+)3.5.3630+2.1.10+
Safari (10.1+) <sup>(1)</sup>4.3.5421+
Edge (18-) <sup>(2)</sup>4.2.5284+
Edge (79+)4.10.6111+2.12.8+
Maxthon2.1.10+
Yandex Browser for Android <sup>(3)</sup>4.2.5291+2.2.6+
Kiwi Browser <sup>(3)</sup>4.11+2.12.8+
Firefox for Android (68-)<sup>(3)</sup>IncompatibleIncompatible2.12.8+
Firefox Nightly for Android (85+) <sup>(3)(4)</sup>Incompatible4.11.6120+2.12.8+

(1) You must upgrade your Windows 10 to 14393 which supports Edge extension.
(2) You must upgrade your macOS to 10.12.4 which supports download attribute of <a> tag.
(3) It's not a good idea to use it on mobile with limited RAM, but it can work, so it's up to you.
(4) Firefox Nightly user requires to follow this steps to install extensions not in default list.

Install This Script

How To Use

  1. Open E-Hentai Gallery
  2. Find your interested gallery
  3. Click "Download Archive" in E-Hentai Downloader box
  4. Have a cup of coffee :coffee:
  5. Save the Zip file

E-Hentai Downloader box

Tips:

How It Works

This script won't download archive from E-Hentai archive download page, so it won't spend your GPs or credits. It will fetch all the pages of the gallery and get their images' URL. Then script will use GM_xmlhttpRequest API (in order to cross origin) to download them. After that, it will package them to a Zip file with JSZip and give it to you with FileSaver.js.

Should Be Noticed

Here are some other compatible information (and some of them are backed to around 10 years ago), which is not important.

Warning And Limitation

Memory Usage

The script will store ALL the data in RAM, not in HDD. This will increase the memory usage of current tab process. So if you don't have enough RAM, or the archive is too large (see file size limit section), please pay attention to your memory usage, or try other download tools.

"Out of memory" problem is the most limitaion of the script (in fact, all the sections of "Warning And Limitation" are about RAM problem, and here is also a specific out of memory tag to label all related issues). If you get an error like out of memory, see solution here. And if you usually have the problem, try other tools.

Browser Developer Tools

To help us debug, the script will output some logs into console (F12 -> Console). If you find a bug, you can keep opening devtools to see and copy the logs. But note that it may increase memory usage and reduce running efficiency. So don't open console only if you want to see the output logs.

File Size Limit

(This part is a bit long, you can just read the table)

Different browsers have different maximum file size limits. Here is a table to show the maximum size the supported browser can handle.

BrowserMaximum Size
Chrome 56-500 MB
Chrome 57+2 GB or (total RAM / 5)
Chrome (with File System)1 GB / > 2GB (with 1.33+)
Firefox2 GB
Opera 15+Same as Chrome
Edge 18-?
Edge 79+Same as Chrome
Safari 10.1+?
Maxthon?

For Google Chrome 56-, it has a hard limit at 500 MB on Blob Storage for years. That means all the files that in storage cannot be larger than 500MB in total, and if the storage doesn't have enough free space to save the next file, it'll return a fake Blob instance silently without any errors. Also for Chrome 45-, Blob.close() didn't implement (and it's depreated so no browser supports it now), so we cannot free those used Blob immediately at that time, only to pary the browser will GC them ASAP (and for most of time it didn't work). That's why here is a wiki page to help you work around this.

So to help you save larger files, the script can save the Zip file into File System, a deprecated HTML5 API but still works on Chrome (as it's Chrome introduce the standard first). With the API, you can handle larger file because the file data will be writing to your disk instead of storing in Blob Storage, its limit is also big enough (10% of your disk free storage, 15 GB in maximum). But when processing the file, the files are still keeping in RAM, and if datas are too large, Chrome may also cannot handle them. From my test the maximum limit maybe 1 GB if you only have 8 GB RAM, but it may also depends on your device. If you have enough RAM, you can download a gallery larger than 2 GB with 1.33+.

Chrome 57+ fixes the 500 MB limit of Blob Storage, so that it can handler larger files in RAM just like File System. Its quota is still exist but it's larger, which bases on the limits below, and here are some examples to make it more clear:

In-memory quota:

Disk quota:

Also, if disk is almost full, we try to keep at least (in-memory quota)*2 disk space available, and we limit the disk quota accordingly.

For Firefox, from our previous data from FileSaver.js, the limit is 800 MB. But from our tests, you can save the file that larger than 800 MB. So we think the limit of Firefox is depending on your device, as it stores the Blob in RAM. If you have a larger RAM, you can save a larger file. However, you should care about your RAM usage, as if Firefox cannot get more RAM to generate Zip, it'll throw an "out of memory" error. To give you some advice, no more than 200 MB if you're using 4 GB RAM, and be care for more than 800 MB if you're using 8 GB RAM.

Opera 15+ is a Chromium-based browser, so you can check its Chromium version and compare it to Chrome version to get your limit. All the other Chromium-based browsers can also use this rule.

Safari 10.1+ finally supports download attribute on <a> tag, so you can now make it works on Safari. We don't have too much data about Safari Blob limit, so if you're dealing with Safari, be care about your RAM usage.

Todo List

See plans and progress here, notice that some of them may changed or removed in some time.

Report A Bug

You can report a bug or give suggestions at GitHub Issue or GreasyFork Feedback. English and Chinese are acceptable :stuck_out_tongue_closed_eyes:

English is not my mother tounge, so if you found any mistakes, don't hesitate to let me know =ω=

Sorry my code is a bit untidy, so it may hard for your development. I'll try optimizing it in a further time :sweat_smile: