ccloli / E-Hentai-Downloader

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

Retry a download will request image URL again and cost more image limits on Tampermonkey #147

Closed ccloli closed 4 years ago

ccloli commented 4 years ago

Since the image limit only cost when requesting image URL (see wiki), the script will use finalUrl field to get the real image URL which is provided by GM_xmlHttpRequest, this should save your image limits when re-downloading.

However, in latest Tampermonkey, it only assigns finalUrl when the request is loaded, and before that the finalUrl is the request URL. That means when re-downloading, the script will request image URL again, and cost your image limits again.

QQ截图20190907162225

The finalUrl is the requesting image URL when the file is not fully downloaded

QQ截图20190907162507

The finalUrl only updates when the file is fully downloaded

It works fine on GreaseMonkey, once GreaseMonkey get the headers of request, it updates finalUrl.

QQ截图20190907162030

Before Tampermonkey fix the bug, maybe we can extract the final URL from tm-finalurlgcal header.

QQ截图20190907162300

For the script user, if you usually needs to restart a download (often request fails or needs to abort if speed is too low), it's better to use GreaseMonkey for now.

derjanb commented 4 years ago

The finalUrl only updates when the file is fully downloaded

Will be fixed at the next BETA release. :)