View Single Post
  #7  
Old 21.07.2019, 11:47
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 625
Default

Quote:
Originally Posted by RPNet-user View Post
..."stop and continue" ... single link if/when the bandwidth for that specific link falls below a specified speed limit ...
Code:
// Restart link, if download speed of the link is less than specified speed.
// Trigger: Interval (Recommended: 60000 or more).

var myHosts = ["uploaded.to", "appwork.org", "jdownloader.org"]; // <- Check links only from these hosts.
var myDuration = 5; // (minutes) <- Check the link speed only after it has been running for atleast this duration.
var mySpeed = 128; // (KiB/s) <- Restart link, if download speed of the link is below this speed.

getRunningDownloadLinks().forEach(function(link) {
    if (myHosts.indexOf(link.getDownloadHost()) == -1) return;
    if (link.getDownloadDuration() < myDuration * 60 * 1000) return;
    if (link.getSpeed() > mySpeed * 1024) return;
    link.abort();
})
Reply With Quote