View Single Post
  #1486  
Old 31.07.2020, 17:13
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 998
Default

Quote:
Originally Posted by Mydgard View Post
... found a example eventscripter "Download zurücksetzen wenn Geschwindigkeit niedrig", can anyone explain a little bit?
Explanation is provided in script comments (green colored text).

Quote:
Originally Posted by Mydgard View Post
Would like to use that only for rapidgator
Replace the example script with the following:

Code:
//check if downloads are running at all
if (isDownloadControllerRunning() && !isDownloadControllerStopping()) {
    var running = getRunningDownloadLinks();
    //loop through all running Downloads
    for (var i = 0; i < running.length; i++) {
        //check if download host is rapidgator.net
        if (running[i].getHost() == "rapidgator.net") {
            //check if the download has been running at least 30 seconds
            if (running[i].getDownloadDuration() > 30000) {
                //check if the current speed is below 50kb/s
                if (running[i].getSpeed() < 50 * 1024) {
                    //stop the download and restart it
                    running[i].abort();
                }
            }
        }
    }
}
Reply With Quote