JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #281  
Old 06.02.2018, 11:14
Hartm Hartm is offline
JD Alpha
 
Join Date: Sep 2017
Posts: 20
Default

hello,
i usually download with 50mbi/s but sometimes it goes down to 1000kb/s so i have to pause and resume the download.. is it possible to make a script for that , that it will every 30 seconds pause/resume the download?
Reply With Quote
  #282  
Old 06.02.2018, 11:51
Hartm Hartm is offline
JD Alpha
 
Join Date: Sep 2017
Posts: 20
Default

Quote:
Originally Posted by mgpai View Post
Code:
// Auto stop/restart downloads if the current average speed is below limit.
// Trigger Required: "Interval"

var minSpeed = 128; // (KiB/s) <- minimum average download Speed.
var minDuration = 0.3; // (minutes) <- minimum download duration per link.
var waitTime = 0.1; // (minutes) <- wait time before restart.

if (running() && getAverageSpeed() < minSpeed * 1024) {
    stopDownloads();
    sleep(waitTime * 60 * 1000);
    startDownloads();
}

// Check if all downloads have been running for atleast the minimum duration.
function running() {
    var links = getRunningDownloadLinks();
    if (links.length > 0) {
        for (i = 0; i < links.length; i++) {
            var link = links[i];
            if (link.getDownloadDuration() < minDuration * 60 * 1000) {
                return false;
            }
        }
        return true;
    } else {
        return false;
    }
}
unfortunately it doesnt work anymore? does it need to be updated? or am i doing something wrong?
Reply With Quote
  #283  
Old 06.02.2018, 12:14
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,340
Default

@Hartm: what exactly doesnt work? there have been no changes to JDownloader and script.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #284  
Old 06.02.2018, 23:22
neik neik is offline
Baby Loader
 
Join Date: Jan 2018
Posts: 8
Default

Quote:
Originally Posted by Jiaz View Post
@neik: you can copy/paste Settings-Advanced Settings, PackagizerSettings.rulelist
For eventscripter, EventScripter.scripts
Thanks Jiaz, the packagizer solved my problem. ;-)
Reply With Quote
  #285  
Old 07.02.2018, 00:05
DaDealer's Avatar
DaDealer DaDealer is online now
JD Adviser
 
Join Date: Oct 2017
Posts: 100
Default

@hartm
Try this script

Trigger is Interval with 10000ms

Code:
//überprüfen, ob überhaupt gedownloadet wird
if (isDownloadControllerRunning() && !isDownloadControllerStopping()) {
    var running = getRunningDownloadLinks();
    //alle laufenden Downloads überprüfen
    for (var i = 0; i < running.length; i++) {
        //überprüfen, ob der Download mindestens seit 30 Sekunden läuft
        if (running[i].getDownloadDuration() > 20000) {
            //überprüfen, ob die Geschwindigkeit unter 500kb/s ist (habe 100.000er - dementsprechend an die eigene Leitung anpassen!)
            if (running[i].getSpeed() < 1000 * 1024) {
                //Reconnecten!
                requestReconnect();
            }

        }
    }
}
__________________
Entpacken klappt nicht? Eventuell RAR5 nicht unterstützt? Dann guck hier: board.jdownloader.org/showthread.php?t=71069
Reply With Quote
  #286  
Old 07.02.2018, 07:45
Hartm Hartm is offline
JD Alpha
 
Join Date: Sep 2017
Posts: 20
Default

Quote:
Originally Posted by DaDealer View Post
@hartm
Try this script

Trigger is Interval with 10000ms

Code:
//überprüfen, ob überhaupt gedownloadet wird
if (isDownloadControllerRunning() && !isDownloadControllerStopping()) {
    var running = getRunningDownloadLinks();
    //alle laufenden Downloads überprüfen
    for (var i = 0; i < running.length; i++) {
        //überprüfen, ob der Download mindestens seit 30 Sekunden läuft
        if (running[i].getDownloadDuration() > 20000) {
            //überprüfen, ob die Geschwindigkeit unter 500kb/s ist (habe 100.000er - dementsprechend an die eigene Leitung anpassen!)
            if (running[i].getSpeed() < 1000 * 1024) {
                //Reconnecten!
                requestReconnect();
            }

        }
    }
}
my downlaodrate dropps to 500kb/s and it should trigger the script right? But it doenst do anyhting.. the download just keeps going... also it would be nice if the download rate dropps under 1Mbi/s

in event scripter i enabled the script due download start is that wrong?

Last edited by Hartm; 07.02.2018 at 08:23.
Reply With Quote
  #287  
Old 07.02.2018, 09:39
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,340
Default

@Hartm: Trigger must be set to 'Interval' mit 1000 ms interval.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #288  
Old 07.02.2018, 13:11
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 610
Default

Quote:
Originally Posted by Hartm View Post
.. is it possible to make a script ... that it will every 30 seconds pause/resume the download?
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/Hartm.js

Last edited by mgpai; 09.02.2018 at 05:11. Reason: Updated script location
Reply With Quote
  #289  
Old 07.02.2018, 17:24
netgearjd netgearjd is offline
JD Fan
 
Join Date: Aug 2014
Posts: 77
Default

I was directed here by Jiaz from my feature request thread, so here's a copy-paste of what I'm looking to do:

-----

Here's an example to illustrate what I'm looking for. Say I have 500 or so links in the LinkGrabber or Downloads list. However I already have 200 of those files downloaded previously. Now it's pointless and a sheer waste of time, power, bandwidth etc. to re-download those 200 files, and it's obviously not feasible to manually look through the 500 and remove the 200.

Now suppose I have a simple text file containing a list of all the files I already have (could be in any location and on any internal or external media, but the list contains only file names and not paths).

What I want is a Subtract File List feature where I can provide the file list to JD, and it will automatically mark (say with red or yellow background) all the links that match the names of files I already have. There should also be a new menu option (along with Delete Links: disabled/failed/finished/offline) i.e. Delete Links: duplicates, so that one can quickly and easily get rid of all the matching links after reviewing them.

The matching links can of course be directly removed from the LinkGrabber or Downloads list too, but highlighting them with a different color will enable users to review which ones they really want to delete. For example a link may exactly match the name of a pre-existing file, but the user may decide to download anyway because the files are different.

-----

So, is this something that can be scripted?
Reply With Quote
  #290  
Old 08.02.2018, 06:20
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 610
Default

Quote:
Originally Posted by netgearjd View Post
... What I want is a Subtract File List feature where I can provide the file list to JD, and it will automatically mark (say with red or yellow background) all the links that match the names of files I already have. There should also be a new menu option (along with Delete Links: disabled/failed/finished/offline) i.e. Delete Links: duplicates, so that one can quickly and easily get rid of all the matching links after reviewing them ...
The option to set foreground/background color to the matching links is not available in the script environment. However, it is possible to remove/rename/disable them. It might also be possible (new API method required) to set comment (e.g. "Duplicate File") to the matching links. Of these methods, disabling the links might be the most convenient, as they can then be easily removed using "Delete Links: disabled" option.

Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/netgearjd.js

Last edited by mgpai; 09.02.2018 at 05:10. Reason: Updated script location
Reply With Quote
  #291  
Old 08.02.2018, 10:04
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,340
Default

@mgpai: thanks for your help and support!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #292  
Old 08.02.2018, 21:33
Hartm Hartm is offline
JD Alpha
 
Join Date: Sep 2017
Posts: 20
Default

Quote:
Originally Posted by mgpai View Post
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/requests/Hartm.js
thanks for that =)
but i dont think it is working? my download goes 65 seconds with 885kbi/s and it doenst reconnect...
Reply With Quote
  #293  
Old 09.02.2018, 05:09
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 610
Default

@Jiaz: Always my pleasure

Quote:
Originally Posted by Hartm View Post
... is it possible to make a script ... that it will every 30 seconds pause/resume the download?
Quote:
Originally Posted by Hartm View Post
... my download goes 65 seconds with 885kbi/s and it doenst reconnect...
The script does not 'reconnect', it checks the download speed between specified intervals and pauses/resumes the downloads if it is below target speed, which I believe is as per your original request.

If that is still what you are looking for, please make sure you have selected 'interval' as trigger and set it to '60000'. For testing purposes you can set a very high target speed (e.g. 1024000) and see if the script is being triggered. You can visually confirm it by watching the pause button in GUI. If the script is working correctly, you should be able to see it being disabled/enabled for the duration specified in the script.

Note: The script has bee moved to:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/Hartm.js
Reply With Quote
  #294  
Old 09.02.2018, 09:28
DaDealer's Avatar
DaDealer DaDealer is online now
JD Adviser
 
Join Date: Oct 2017
Posts: 100
Default

Hi,
i'm searching a script for automatic update. the last one i got is not working.
__________________
Entpacken klappt nicht? Eventuell RAR5 nicht unterstützt? Dann guck hier: board.jdownloader.org/showthread.php?t=71069
Reply With Quote
  #295  
Old 09.02.2018, 10:09
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 610
Default

Quote:
Originally Posted by DaDealer View Post
... i'm searching a script for automatic update. the last one i got is not working.
Restart and update when Idle? Which script did you try?
Reply With Quote
  #296  
Old 09.02.2018, 13:26
DaDealer's Avatar
DaDealer DaDealer is online now
JD Adviser
 
Join Date: Oct 2017
Posts: 100
Default

i got one that was checking every 8 hours if there is an update or not. when theres was one, JD ask everytime time if it is ok to update. i need one that is not asking.
__________________
Entpacken klappt nicht? Eventuell RAR5 nicht unterstützt? Dann guck hier: board.jdownloader.org/showthread.php?t=71069
Reply With Quote
  #297  
Old 09.02.2018, 14:05
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 610
Default

Quote:
Originally Posted by DaDealer View Post
i got one that was checking every 8 hours if there is an update or not. when theres was one, JD ask everytime time if it is ok to update. i need one that is not asking.
Have you tried this script? Here is a newer version, which includes an additional 'linkcollector' check. To execute the script every 8 hours, set the 'Interval' to '28800000'.

Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/DaDealer.js

We can also check/modify your existing script, if you post it here. If you have a different solution in mind, feel free to suggest it.
Reply With Quote
  #298  
Old 09.02.2018, 19:28
DaDealer's Avatar
DaDealer DaDealer is online now
JD Adviser
 
Join Date: Oct 2017
Posts: 100
Default

the script was:

Code:
// Check if updates are availaible when JD is idle
if (callAPI("update", "isUpdateAvailable") && isDownloadControllerIdle()) {
    // Restart JD and Update
    callAPI("update", "restartAndUpdate")
}
i try the new one. we will see if it works or not. thank you mgpai
__________________
Entpacken klappt nicht? Eventuell RAR5 nicht unterstützt? Dann guck hier: board.jdownloader.org/showthread.php?t=71069
Reply With Quote
  #299  
Old 09.02.2018, 21:45
Hartm Hartm is offline
JD Alpha
 
Join Date: Sep 2017
Posts: 20
Default

Quote:
Originally Posted by mgpai View Post
@Jiaz: Always my pleasure





The script does not 'reconnect', it checks the download speed between specified intervals and pauses/resumes the downloads if it is below target speed, which I believe is as per your original request.

If that is still what you are looking for, please make sure you have selected 'interval' as trigger and set it to '60000'. For testing purposes you can set a very high target speed (e.g. 1024000) and see if the script is being triggered. You can visually confirm it by watching the pause button in GUI. If the script is working correctly, you should be able to see it being disabled/enabled for the duration specified in the script.

Note: The script has bee moved to:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/Hartm.js

yes sorry it works.. i didnt see that because i mean something different.. i mean stop and go...

i have to completely stop the download and then start it again to regain fullspeed....

do i have to change setDownloadsPaused to setDownloadsStart ?
Reply With Quote
  #300  
Old 10.02.2018, 07:45
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 610
Default

Quote:
Originally Posted by Hartm View Post
... i have to completely stop the download and then start it again to regain fullspeed....

do i have to change setDownloadsPaused to setDownloadsStart ?
If a download is fully stopped, an additional check to verify the download duration is required to ensure sufficient time is given to reach its normal speed again.

Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/Hartm_2.js
Reply With Quote
Reply

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 16:06.
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 - 2019, Jelsoft Enterprises Ltd.