#1
|
|||
|
|||
Asking for script to restart JDownloader2
I want to make Jdownloader2 restart if the download speed under 30 KB. I don't have any previous knowledge with Javascript to write the script, your help is much appreciated.
It will be great too if you provide me with script to restart jdownloader2 after specifics periods like every 2 hour or so. Thanks in advance |
#2
|
||||
|
||||
In EventScripter (Settings-EventScripter) there is a button for 'Example Scripts', it resets a download if speed is slower than 50 kb/s. Reset = Restart from beginning!
__________________
JD-Dev & Server-Admin |
#3
|
||||
|
||||
__________________
JD-Dev & Server-Admin |
#4
|
|||
|
|||
Quote:
Is there any way to restart JD itself? // Some of Youtube videos stop downloading after some progress. The only way to resume them is by restarting JD itself. I have tried Stop/Start again but it didn't work. So, the reset action will lose any progress while the file could resume. |
#5
|
||||
|
||||
Please provide a logfile for the youtube issue. Menu -> Help -> Create log and give logID
No, at the moment it is not possible. That's why I created the ticket.
__________________
JD-Dev & Server-Admin |
#6
|
|||
|
|||
Will this work?
Trigger : Interval 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 host is youtube.com if (running[i].getHost() == "youtube.com") { //check if the download has been running at least 30 seconds if (running[i].getDownloadDuration() > 30000) { //check if the current speed is below 30kb/s if (running[i].getSpeed() < 30 * 1024) { //restart JD callAPI("system", "restartJD") } } } } } |
#7
|
||||
|
||||
test it nothing bad can happen
__________________
JD-Dev & Server-Admin |
#8
|
|||
|
|||
Quote:
Thank you verrry much. It works like a charm. If you wouldn't mind, what about -instead of restarting JD- disabling the current link so JD goes to the next link and starting it?! |
#9
|
|||
|
|||
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 host is youtube.com if (running[i].getHost() == "youtube.com") { //check if the download has been running at least 30 seconds if (running[i].getDownloadDuration() > 30000) { //check if the current speed is below 30kb/s if (running[i].getSpeed() < 30 * 1024) { //Get link UUID var long1 = [running[i].getUUID()] //Disable Link callAPI("downloadsV2", "setEnabled", false, long1, []) } } } } } Last edited by mgpai; 15.10.2015 at 09:30. |
#10
|
||||
|
||||
@mgpai: nice work! *thumbs up*
__________________
JD-Dev & Server-Admin |
#11
|
|||
|
|||
Thaaaaaaaaaaaaaaaaaaanks
|
#12
|
|||
|
|||
@Jiaz... Thanks
@karimmaster101... You are welcome. |
#13
|
||||
|
||||
If you want JD to autostart the downloads after a restart, you should enable the option either in the advanced config, or via this eventscript line:
Code:
callAPI("config", "set", "org.jdownloader.settings.GeneralSettings",null, "autostartdownloadoption", "ALWAYS");
__________________
|
#14
|
|||
|
|||
How could one change the script that it automatically restarts JD if all downloads together have a speed less than 30 kb/h or 0 kb/h and after unzipping (if it unzipps, if not just restart after that speed)?
|
#15
|
||||
|
||||
@Fetter Biff: Ich schlage vor, du fragst direkt mgpai um Hilfe!
__________________
JD-Dev & Server-Admin |
#16
|
|||
|
|||
Ist gut, er wird das hier ja bestimmt auch sehen. Oder meinst Du, ich sollte ihn noch anders ansprechen?
|
#17
|
|||
|
|||
Quote:
|
#18
|
||||
|
||||
@mgpai: Thanks!
@Fetter Biff: Da siehste
__________________
JD-Dev & Server-Admin |
#19
|
|||
|
|||
Ja, vielen Dank nochmals!
|
#20
|
|||
|
|||
Is JD restarted only if there was a download downloaded faster than the time set in the script before which now has finished? Or even if there was no download before?
Cannot get it to work at the moment: Is that correct? |
#21
|
||||
|
||||
@Fetter Biff: the script only triggers when speed is 0, if you want other condition, ask mgpai for help with modification of script
__________________
JD-Dev & Server-Admin |
#22
|
|||
|
|||
Ja, ich dachte, das täte ich, in dem ich hier fragte.
The speed is null but it does not trigger obviously. |
#23
|
|||
|
|||
With default settings, if there are active downloads and the the speed is 0 for more than 120 seconds and there is no linkchecking/crawling/extraction activity, the script will (should) restart JD.
You can also find me in JD chat if you want any assistance with troubleshooting. |
#24
|
|||
|
|||
Alright. I will go on trying.
Chat, OK, many thanks! |
Thread Tools | |
Display Modes | |
|
|