JDownloader Community - Appwork GmbH
 

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 02.02.2020, 12:31
ckbaxter ckbaxter is offline
JD Beta
 
Join Date: May 2009
Posts: 53
Default

Danke Coder und mgpai,

ich denke ich hab's jetzt gelöst, wie gesagt bin nicht so der Programmierer, die Lösung von mgpai klingt gut, aber kann ich mit meinen Wissen nicht umsetzen.

So hab ich es gelöst (eine Kombination aus mehreren Scripten):
Spoiler:

Code:
disablePermissionChecks();

var mySeconds = 600; // (in seconds) <- Restart JD if speed remains at zero for this duration.
var links = getAllDownloadLinks();

for (i = 0; i < links.length; i++) {
    var link = links[i];
    if (link.getStatus() == "Starte..." || link.getStatus() == "Starting...") {
        if (isSpeedZero()) {
            var elapsed = 0;
            while (isSpeedZero() && elapsed < mySeconds) {
                elapsed++;
                sleep(1000);
            }
            if (isSpeedZero() && isIdle()) callAPI("system", "restartJD");
        }

    }
}

//Functions
function isSpeedZero() {
    return getRunningDownloadLinks().length && !getTotalSpeed();
}

function isIdle() {
    if (callAPI("linkcrawler", "isCrawling")) return;
    if (callAPI("linkgrabberv2", "isCollecting")) return;
    if (callAPI("extraction", "getQueue").length > 0) return;
    return true;
}

Wahrscheinlich nicht elegant und programmiertechnisch eine Katastrophe, aber scheint zu funktionieren.

Last edited by ckbaxter; 04.02.2020 at 18:41.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 15:13.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.