Bug #11059

[DEV]Exception with LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE and waittime are ignored

Added by editestowy about 7 years ago. Updated over 6 years ago.

Status:NewStart date:01/18/2014
Priority:UrgentDue date:
Assignee:jiaz% Done:


Target version:-


When jd.plugins.BrowserAdapter.openDownload method throws exception
"connect timed out" (probably because of the specific download server is down)
and we want to display LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE
and aply waittime for this link, then this status is ignored by the Core.

If this exceptions is thrown in the handlePremium,
then JD tries to continue download the link
with handleFree, and then the same error happens.
If the free download requires (re)Captcha, the (re)Captcha window is displayed!
It is weird because the problem is with "not available link" so switching from
Premium to Free won't help at all.

This status should work as it is described for ERROR_TEMPORARILY_UNAVAILABLE:
"Plugins:Download is not possible right now. May be back later. Maybe server problems or anything like this" - so it should retry later (after wait time expired) not immediately trying to switch from
Premium to Free.

So please add the possibility to stop the download of the link (do not try the free download)
and apply wait time when exception with ERROR_TEMPORARILY_UNAVAILABLE is reported in Premium.
Using other status: ERROR_DOWNLOAD_FAILED works partially correctly - it stops the download
but the waittime is ignored and user has to manually restart the link (also the status message
is not explaining the real reason for this problem).

Example from the handlePremium method:

try {
dl = jd.plugins.BrowserAdapter.openDownload(br, link, Encoding.htmlDecode(dllink), true, 0);
} catch (Exception e) {
if (e.getMessage().equals("connect timed out"))
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, e.getMessage(), 5 * 60 * 1000l);
throw new PluginException(LinkStatus.ERROR_DOWNLOAD_FAILED);

Printscreens show how it works now:
01. Connect_Time_out.jpg - handlePremium throws exception, we want to display the reason and apply waittime
if it is "connect timed out"
02. plugin_exception.jpg - message to display in PluginException class
03. SingleDowloadController_exception.jpg - deeper in the Core...
04. handleFree.jpg - Core doesn't try stop the download and apply waittime, it tries with handleFree
05. free_reCaptcha.jpg - free downloads requires reCaptcha so the window is displayed to enter it, then it fails because link is still unavailable or download limit reached (hoster counted the download even when the real download never started).
06. real_error.jpg - real error from browser - looks like download server is down (however hoster database still reports it as availabe)

01._Connect_Time_out.jpg (235 KB) editestowy, 01/18/2014 06:53 PM

02._plugin_exception.jpg (220 KB) editestowy, 01/18/2014 06:53 PM

03._SingleDowloadController_exception.jpg (242 KB) editestowy, 01/18/2014 06:53 PM

04._handleFree.jpg (241 KB) editestowy, 01/18/2014 06:53 PM

05._free_reCaptcha.jpg (172 KB) editestowy, 01/18/2014 06:53 PM

06._real_error.jpg (163 KB) editestowy, 01/18/2014 06:53 PM

Related issues

Related to Bug #12490: Exception for temp issues New 03/10/2014
Related to Bug #11435: PluginException with LinkStatus.ERROR_TEMPORARILY_UNAVAIL... New 02/27/2014 03/31/2014

Also available in: Atom PDF