ccloli / E-Hentai-Downloader

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

Single Large Page Download Fault (eg>30MB) 單張圖片太大下載失敗 #179

Closed fmnijk closed 3 years ago

fmnijk commented 3 years ago

有的本子封面、尾頁、漢化組宣傳圖 會特別大 單張數十MB 載下來無法讀取

ccloli commented 3 years ago

Hi, 能否提供一些存在問題的頁面鏈接?

ccloli commented 3 years ago

試著從之前的數據庫里查出來了平均單文件最大的 gallery,每個文件將近 50MB

image

試著下載了第一頁(所有原始文件實在太大了,沒有足夠的配額),打開是沒有問題的

image

無法讀取的情況是什麼?文件是因網路傳輸問題中斷了還是下載的文件是損壞的?如果是前者的話腳本應該沒法處理;如果是後者的話可否提供有問題的頁面連接並提供損壞的文件副本?

fmnijk commented 3 years ago

您好 剛找到一個失敗的鏈接 未滿18禁止 第一頁是48.14MB 下載後解壓僅147KB且無法打開 另外我剛剛試您給的鏈接第一頁卻是OK的

ccloli commented 3 years ago

試了下確實存在這個問題,但是奇怪的是直接下載時文件是完好的,所以原始文件是沒問題的。

而且更奇怪的是使用 Firefox 瀏覽器是沒有問題的,如下截圖從上至下依次是 Chrome + ViolentMonkey / Chrome + Tampermonkey / Firefox + Tampermonkey,可見 Firefox 下能正常下載文件(就是因為文件比較大所以 Tampermonkey 轉換比較慢),文件大小和內容也是符合預期的。既然 Tampermonkey 在 Firefox 下沒問題,那問題可能不是出在 Tampermonkey 下,Chrome 下換用了別的擴展結果拿到了空文件,兩個擴展同時出錯的概率應該比較小,所以懷疑是 Chrome 本身的問題。

這個問題懷疑和 #171 是相同的問題,估計是 Chrome 本身的問題。之前也調查了一陣,發現網路請求也是正常的,文件是確實下載完成了的,但是最終文件是空的,所以暫時找不到解決方案。現階段可能需要換用 Firefox 或其他工具。

image

TestPolygon commented 3 years ago

This is fixed only in beta version of Violent Monkey:

https://github.com/violentmonkey/violentmonkey/issues/1066#issuecomment-703157557

(I assume that that issue is about this bug)

ccloli commented 3 years ago

This is fixed only in beta version of Violent Monkey: https://github.com/violentmonkey/violentmonkey/issues/1066#issuecomment-703157557 (I assume that that issue is about this bug)

Yep, checked it just now, and both the gallery in this issue and #171 are works fine now. So maybe Tampermonkey also needs a fix.

image

(Also BTW, the issue you mentioned also said the file is lag and slow in Tampermonkey, that's because instead of using responseType: 'blob' / 'arraybuffer', Tampermonkey treats blob data as string, then convert it to arraybuffer, and even not using web worker, so the browser will be freeze if the file is too large. I created an issue(1) about this a few years ago but looks like it doesn't updated.)

(Also BTW I noticed an issue(2) on Tampermonkey, if it changes, maybe we can use it to resume download progress when it fails -- just maybe, feel tired in real life and have no energy to improve the script lol)

(1) https://github.com/Tampermonkey/tampermonkey/issues/279 (2) https://github.com/Tampermonkey/tampermonkey/issues/1050

ccloli commented 3 years ago

This bug should be fixed in Tampermonkey BETA v4.12.6124. BTW download freezed should also be fixed.

此问题应该已在 Tampermonkey BETA v4.12.6124 中修复。此外下载时浏览器无响应的问题应该也被一同修复。

ccloli commented 3 years ago

Tampermonkey has released v4.12 to stable channel, this issue should be fixed for most users soon.