View Single Post
  #60  
Old 29.03.2017, 06:11
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 561
Default

Quote:
Originally Posted by Tyler View Post
... one link is downloading at 128kb\s leave that alone, but if another is downloading at 50kb/s have it stopped and then started.
Code:
// Stop and restart slow links.
// Trigger Required: "Interval" (Recommended: 30000 or more).
// IMPORTANT: Enable "Synchronous execution of script" (checkbox).

var minSpeed = 128; // (KiB/s) <- minimum download speed per link.
var minDuration = 1; // (minutes) <- minimum download duration per link.

var links = getRunningDownloadLinks();

for (i = 0; i < links.length; i++) {
    var link = links[i];
    if (link.getDownloadDuration() < minDuration * 60 * 1000) continue;
    if (link.getSpeed() > minSpeed * 1024) continue;
    link.abort();
}
Reply With Quote