#281
|
|||
|
|||
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? |
#282
|
|||
|
|||
Quote:
|
#283
|
||||
|
||||
@Hartm: what exactly doesnt work? there have been no changes to JDownloader and script.
__________________
JD-Dev & Server-Admin |
#284
|
|||
|
|||
Thanks Jiaz, the packagizer solved my problem. ;-)
|
#285
|
|||
|
|||
@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(); } } } } |
#286
|
|||
|
|||
Quote:
in event scripter i enabled the script due download start is that wrong? Last edited by Hartm; 07.02.2018 at 09:23. |
#287
|
||||
|
||||
@Hartm: Trigger must be set to 'Interval' mit 1000 ms interval.
__________________
JD-Dev & Server-Admin |
#288
|
|||
|
|||
Quote:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/Hartm.js Last edited by mgpai; 09.02.2018 at 06:11. Reason: Updated script location |
#289
|
|||
|
|||
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? |
#290
|
|||
|
|||
Quote:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/netgearjd.js Last edited by mgpai; 09.02.2018 at 06:10. Reason: Updated script location |
#291
|
||||
|
||||
@mgpai: thanks for your help and support!
__________________
JD-Dev & Server-Admin |
#292
|
|||
|
|||
Quote:
but i dont think it is working? my download goes 65 seconds with 885kbi/s and it doenst reconnect... |
#293
|
|||
|
|||
@Jiaz: Always my pleasure
Quote:
Quote:
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 |
#294
|
|||
|
|||
Hi,
i'm searching a script for automatic update. the last one i got is not working. |
#295
|
|||
|
|||
Restart and update when Idle? Which script did you try?
|
#296
|
|||
|
|||
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.
|
#297
|
|||
|
|||
Quote:
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. |
#298
|
|||
|
|||
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") } |
#299
|
|||
|
|||
Quote:
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 ? |
#300
|
|||
|
|||
Quote:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/Hartm_2.js |
#301
|
|||
|
|||
Hi, I am running a Pi2 with Ubuntu Mate 16.04 and JDownloader headless. How can I go about making the following work using event scripter:
Event: when download controller starts Code:
*if files exist in folder /home/myuser/myfolder* then "killall transmission-gtk" #This is a Linux command normally run in terminal *end* Code:
"killall transmission-gtk" Code:
call home/myuser/myscript.sh "transmission-gtk %U -m" #must only run after myscript.sh has finished Code:
#!/bin/bash for i in /home/myuser/myfolder/*.mp4 do /usr/local/bin/gdrive upload --delete "$i" #uploads file to google drive and then deletes it from disk done |
#302
|
|||
|
|||
Something like this should work. Jiaz should be able to confirm.
Event: when download controller starts Code:
var myFolder = "/home/myuser/myfolder"; var fileExists = getPath(myFolder).getChildren().length; if (fileExists) callAsync(null, "killall", "transmission-gtk"); Event: when download starts Code:
callAsync(null, "killall", "transmission-gtk"); Event: when download controller stops Code:
var myScript = "home/myuser/myscript.sh"; callSync(myScipt); callAsync(null, "transmission-gtk", "%U", "-m");
|
#303
|
|||
|
|||
Quote:
Quick question, is there any difference in running the "transmission-gtk" commands Synchronous or Asynchronous ? And all the event scripts should be set as Synchronous ? EDIT: Also is it possible to update and restart Jdownloader at a certain time of the day if and only if updates are available ? I noticed that you set a "start time" on page 1 and used the interval trigger. Last edited by RPH; 11.02.2018 at 13:53. |
#304
|
|||
|
|||
thank you very much works like a charm =)
|
#305
|
|||
|
|||
Based on my earlier question about updating & restarting JDownloader at a specific time of the day if an update is available, I wrote this script:
Code:
var t = [03, 45]; //Set Starting Time if (isDownloadControllerIdle() && isUpdateAvailable()) { interval = 1000; restartAndUpdate(); } else { var timeDiff = (new Date().setHours(t[0], t[1])) - (new Date()); if (timeDiff <= 0) { interval = (86400000) - Math.abs(timeDiff); } else { interval = timeDiff; } } //Functions function isUpdateAvailable() { return callAPI("update", "isUpdateAvailable"); } function restartAndUpdate() { callAPI("update", "restartAndUpdate"); } I didn't want to have the interval running every second or every minute until the starting time.... EDIT: I changed the code to not use the modulus and it seems to be working fine now. But how can I check if another script is running ??? I don't want the update to run if my "Event: when download controller stops" script is running. Last edited by RPH; 12.02.2018 at 17:32. Reason: Corrected script. |
#306
|
|||
|
|||
First of all, thanks a lot for the script. Simple, yet 100% effective.
Quote:
@Jiaz: Can we have a new API method to set the link comment from a script? @mgpai: As for the script itself, I want to make one small improvement if possible - how can I add a check to see whether the file exists or not before it is read, and display a simple warning dialog and abort execution if it doesn't exist? |
#307
|
|||
|
|||
Quote:
Enable the "Synchronous Execution" in a script, to wait for the current instance of the script to end, before executing subsequent instance(s) of the same script, if/when triggered. |
#308
|
|||
|
|||
Quote:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/netgearjd.js Last edited by mgpai; 13.02.2018 at 07:41. Reason: Made link to the script visible |
#309
|
|||
|
|||
Use setProperty() to set a global property in your "Event: when download controller stops" script to indicate that it is running and use getProperty() in your update script to access/check that property before restarting to update.
|
#310
|
|||
|
|||
Quote:
|
#311
|
||||
|
||||
@mgpai: Thanks for providing great support here !
@RPH: mgpai will be great eventscript teacher for you be nice and you will become master like him
__________________
JD-Dev & Server-Admin |
#312
|
|||
|
|||
Hi guys, I got a big problem. While testing my scripts, I set the "updateAndRestart" command to run if JDownloader is idle with the interval as 1000ms. Now as soon as JDownloader starts, it restarts and I cannot use it.
How can I disable this ? Thanks |
#313
|
|||
|
|||
@RPH: You can disable the script by editing "org.jdownloader.extensions.eventscripter.EventScripterExtension.scripts.json" which can be found in 'cfg' folder.
|
#314
|
||||
|
||||
In your cfg folder you will find org.jdownloader.extensions.eventscripter.EventScripterExtension.scripts.json
either remove it or edit and search enabled and set to false
__________________
JD-Dev & Server-Admin |
#315
|
|||
|
|||
Quote:
Once I have given it permission it will not ask for it again, correct ? Even if JDownloader shuts down and turns on again with say a power outage ? Because I am sure I have given it permissions before but it still asks. Last edited by RPH; 16.02.2018 at 14:31. |
#316
|
||||
|
||||
Ah, its about permission. This one is saved in JDownloader. Yes, the permission is saved and not asked again. Permissions are on per method basis
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 16.02.2018 at 14:46. |
#317
|
|||
|
|||
Quote:
Code:
if (isDownloadControllerIdle() && isUpdateAvailable()) { interval = 1000; restartAndUpdate(); } Last edited by RPH; 16.02.2018 at 15:24. |
#318
|
||||
|
||||
@RPH: I just checked, permissions are stored for that script. when you change it, permissions are lost
__________________
JD-Dev & Server-Admin |
#319
|
|||
|
|||
Quote:
How would I go about allowing permissions for my "update check" then, because it is set to run in the early hours of the morning and only when an update is available ? It's thus not possible for me to sit and wait for the permission dialog box to appear on myJDownloader. |
#320
|
||||
|
||||
I will add easy method to disable permission checks
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|