ccloli / E-Hentai-Downloader

Download E-Hentai archive as zip file
GNU General Public License v3.0
1.82k stars 137 forks source link

abData is not defined - Error generating zip file - Chromium #196

Open ImBadImSorry opened 2 years ago

ImBadImSorry commented 2 years ago

Running on Chromium: 94.0.4606.71

Tried to download a 5 GB archive, but uh...an error occurred. It got to the "Generating Zip File... " progress bar and got to the very last element and it just stopped. I opened up the console, and I got this: Uncaught (in promise) ReferenceError: abData is not defined at errorHandler (VM93 userscript.html:12597)

Line 12597+


const errorHandler = function (error) {
  abData = undefined; // Errored here.
  pushDialog('An error occurred when generating Zip file as ArrayBuffer.');
  console.error('[EHD] An error occurred when generating Zip file as ArrayBuffer.');
  console.error(error);
ImBadImSorry commented 2 years ago

Removing abData = undefined prompts to try again and prints out the error and allows for a re-try.

By the way, the error that I forgot for my particular case was:

RangeError: Array buffer allocation failed at new ArrayBuffer () at new Uint8Array () at concat (userscript.html?name=E-Hentai%20Downloader.user.js&id=b76891d8-a8e5-48f6-9dc8-1c7539e0c0db:2645) at StreamHelper.eval (userscript.html?name=E-Hentai%20Downloader.user.js&id=b76891d8-a8e5-48f6-9dc8-1c7539e0c0db:2686) at eval (userscript.html?name=E-Hentai%20Downloader.user.js&id=b76891d8-a8e5-48f6-9dc8-1c7539e0c0db:3502) at module.exports (userscript.html?name=E-Hentai%20Downloader.user.js&id=b76891d8-a8e5-48f6-9dc8-1c7539e0c0db:4444) at queue. (userscript.html?name=E-Hentai%20Downloader.user.js&id=b76891d8-a8e5-48f6-9dc8-1c7539e0c0db:4517) at Number.run (userscript.html?name=E-Hentai%20Downloader.user.js&id=b76891d8-a8e5-48f6-9dc8-1c7539e0c0db:4505) at MessagePort.listener (userscript.html?name=E-Hentai%20Downloader.user.js&id=b76891d8-a8e5-48f6-9dc8-1c7539e0c0db:4509)

Of course, I retry but it failed. Apparently, Google suppressed the confirm dialogue because it wasn't on the active tab -

A window.confirm() dialog generated by this page was suppressed because this page is not the active tab of the front window. Please make sure your dialogs are triggered by user interactions to avoid this situation. https://www.chromestatus.com/feature/5140698722467840

So yeah... good luck!

ccloli commented 2 years ago

As noted in README.md, it's not recommended to download a gallery which is too large. For Chrome I remembered the maximum size can be allocated is about 2GB? 5GB is too large, you should use Pages Range to download such gallery.

As all the files are stored in RAM and with browser's limitations, the script is not intended to download a large gallery (the script should warn you if you download a gallery larger than around 300MB), for large gallery you should use other tools or split it to smaller zips with Pages Range.