Quote:
Originally Posted by mgpai
Code:
// Disable pending links of user-specified hosts, after x retries
// Trigger: A Download Stopped
var myHosts = ["host.com", "host.org", "host.net"]; // <- set host names
var myMaxTries = 5; // <- set max. number of retries allowed
var host = link.getHost();
var totalTries = link.getSessionProperty("count") || 0;
if (myHosts.indexOf(host) > -1) {
if (totalTries < 5) {
if (link.isEnabled()) link.setSessionProperty("count", totalTries + 1);
} else if (totalTries >= 5) {
link.setSessionProperty("count", 0);
getAllDownloadLinks().filter(function(link2) {
return link2.getHost() == host && !link2.isFinished() && !link2.getSpeed();
}).forEach(function(link3) {
link3.setEnabled(false);
})
}
}
|
Is it possible set it for all host names? I ask it for all host names because the topic below:
Protecting captcha credits against endless loops:
https://board.jdownloader.org/showth...821#post459821