JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #421  
Old 16.04.2018, 18:58
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,529
Default

Quote:
Originally Posted by FlyAway View Post
... is possible add a rule that limits the maximum number of reconnections. Leaving the modem on at night I would not want it to burn
The script performs reconnects (only when there are active downloads) based on your speed limit and the duration taken by the downloads to reach that speed. As long as you determine/set optimal values for those parameters, there will be no risk your modem 'burning' out. The script currently waits till all downloads have been running for atleast 60 seconds (60000ms), before checking the speed limit. If your connection takes longer to reach the minimum speed, you can try increasing that value in the script, to prevent any unnecessary reconnects. If you want to track the number of reconnects triggered by the script, I can provide you a code which can log the timestamps to a file.

Quote:
I have pasted your code in a new script, I hope I have done well. But it does not work, the router will not restart. I am attaching the screens
I am unable to make out much from the thumbnails of your screenshot (Please wait for Jiaz to check it). Make sure you have followed all the instructions given in the script (selected the right trigger, set interval correctly, enabled checkbox etc.).
Reply With Quote
  #422  
Old 16.04.2018, 21:32
Takhen Takhen is offline
DSL User
 
Join Date: Mar 2018
Posts: 38
Default

Quote:
Originally Posted by mgpai View Post
While it is possible to detect if the exists on disk, it is not possible to extend the GUI functionality of 'skip file if exists' to the event scripter. The links can only be disabled/removed or temporarily skipped to prevent it from being downloaded.

The current method limits the number (depth) of sub-folders which can be checked. Please wait for Jiaz to respond regarding request for new API method.

@Jiaz: Would it be possible to provide recursive list of the files and folders on the disk, something like:

Code:
var myFilePath[] = myFilePath.getChildrenRecursive();

Also can a method similar to "Mark as Finished" menu command be added?
Sorry for late answer, I tried to read more times but I'm not sure to understand. That's not my womanlanguage and informatics is not too...

Maybe I could better explain my request: I'm not talking only for "search folder and subfolder and skip to download existing files", the general idea was to avoid to donwload duplicates, each method is ok (I said about "search in the folder" because if JD skip downloads by using an "internal memory" of links downloaded, a format of windows could totally unable the skill). However: the general idea is for moving downloaded files. This can be done out from the donwload folder, or can be done in a subfolder if easier to do.

Did you said there is a way, no care which one, to do something like this, or you said there is no way? Thanks, sorry for my missunderstanding
Reply With Quote
  #423  
Old 17.04.2018, 00:06
FlyAway FlyAway is offline
JD Beta
 
Join Date: Feb 2013
Posts: 51
Default

Quote:
Originally Posted by mgpai View Post
The script performs reconnects (only when there are active downloads) based on your speed limit and the duration taken by the downloads to reach that speed. As long as you determine/set optimal values for those parameters, there will be no risk your modem 'burning' out. The script currently waits till all downloads have been running for atleast 60 seconds (60000ms), before checking the speed limit. If your connection takes longer to reach the minimum speed, you can try increasing that value in the script, to prevent any unnecessary reconnects. If you want to track the number of reconnects triggered by the script, I can provide you a code which can log the timestamps to a file.



I am unable to make out much from the thumbnails of your screenshot (Please wait for Jiaz to check it). Make sure you have followed all the instructions given in the script (selected the right trigger, set interval correctly, enabled checkbox etc.).
Is it possible to set the script to run for a defined number of times?


Ok We wait Jiaz...in any case I have only copied and pasted your script without modifying anything and I have checked the item "synchronous execution of the scripts" as specified in the script. And obviously enabled the script.
Thanks!
Reply With Quote
  #424  
Old 17.04.2018, 06:33
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,529
Default

Quote:
Originally Posted by Takhen View Post
... Did you said there is a way, no care which one, to do something like this, or you said there is no way? ...
I have already posted a script in Post #414. If the file already exists in the sub-folders (of the download folder), the link will be disabled, to prevent it from being downloaded again.
Reply With Quote
  #425  
Old 17.04.2018, 06:37
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,529
Default

Quote:
Originally Posted by FlyAway View Post
Is it possible to set the script to run for a defined number of times?
If you just want to know if it is possible. Yes it is possible. But if you are asking me if I can add it to this script. Sorry I will have to decline.
Reply With Quote
  #426  
Old 17.04.2018, 09:09
FlyAway FlyAway is offline
JD Beta
 
Join Date: Feb 2013
Posts: 51
Default

Quote:
Originally Posted by mgpai View Post
If you just want to know if it is possible. Yes it is possible. But if you are asking me if I can add it to this script. Sorry I will have to decline.
thanks anyway, do not worry it was just for the history of the modem turned on at night. Mega.co, I do not know why, sometimes download certain files at low speed and if it happens at night, with your script, the router would continue to be rekindled.

how stupid I am, I had not read that, in the script, there is specified to set "Interval" as Target :( I think that's the problem, I try it tonight and I'll let you know

Last edited by FlyAway; 17.04.2018 at 09:15.
Reply With Quote
  #427  
Old 17.04.2018, 09:57
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,529
Default

Quote:
Originally Posted by FlyAway View Post
... it was just for the history of the modem turned on at night. Mega.co, I do not know why, sometimes download certain files at low speed and if it happens at night, with your script, the router would continue to be rekindled ...
You can use this code to control the time at which the script will run. Insert it after Line 10:

Code:
var h = new Date().getHours();
if (h < 6 || h > 20) return;

In this example the script will run only between 6 AM and 9 PM.
Reply With Quote
  #428  
Old 17.04.2018, 13:19
FlyAway FlyAway is offline
JD Beta
 
Join Date: Feb 2013
Posts: 51
Default

Quote:
Originally Posted by mgpai View Post
You can use this code to control the time at which the script will run. Insert it after Line 10:

Code:
var h = new Date().getHours();
if (h < 6 || h > 20) return;

In this example the script will run only between 6 AM and 9 PM.

thanks for the help but 6 or 7 hours of reconnections I think disinterrupt the router Do not worry, it's not important.

Unfortunately I tried your script having enabled the trigger but it does not work, does not reconnect :(
Reply With Quote
  #429  
Old 17.04.2018, 13:21
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,236
Default

@FlyAway: you should modify script to test it first if reconnect works at all
Does Reconnect work for you? did you setup it first?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #430  
Old 17.04.2018, 13:27
FlyAway FlyAway is offline
JD Beta
 
Join Date: Feb 2013
Posts: 51
Default

Quote:
Originally Posted by Jiaz View Post
@FlyAway: you should modify script to test it first if reconnect works at all
Does Reconnect work for you? did you setup it first?
I do not think I understood. The reconnect function works correctly, it does not work when it is invoked by the script
Reply With Quote
  #431  
Old 17.04.2018, 13:37
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,236
Default

did you enable Settings-Reconnect -> Reconnects can interrupt resumable downloads?
Not resumeable downloads will block the reconnect. you would need to modify script to stop running downloads first
__________________
JD-Dev & Server-Admin
Reply With Quote
  #432  
Old 17.04.2018, 13:40
FlyAway FlyAway is offline
JD Beta
 
Join Date: Feb 2013
Posts: 51
Default

Quote:
Originally Posted by Jiaz View Post
did you enable Settings-Reconnect -> Reconnects can interrupt resumable downloads?
Not resumeable downloads will block the reconnect. you would need to modify script to stop running downloads first
yes, I have all enabled

I have deleted all list of file in queue, restart JD2 and seem to be working. This night I test it.
Any idea for limit of number of reconnection?

Last edited by FlyAway; 17.04.2018 at 13:48.
Reply With Quote
  #433  
Old 17.04.2018, 15:16
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,236
Default

You can modify script to check global map of reconnects done and add an additional script that always increases when reconnect is started 'Before A Reconnect' and 'After A Reconnect'. Better ask mgpai for help with this
__________________
JD-Dev & Server-Admin
Reply With Quote
  #434  
Old 18.04.2018, 09:50
Takhen Takhen is offline
DSL User
 
Join Date: Mar 2018
Posts: 38
Default

Quote:
Originally Posted by mgpai View Post
I have already posted a script in **External links are only visible to Support Staff**.... If the file already exists in the sub-folders (of the download folder), the link will be disabled, to prevent it from being downloaded again.
I'm trying it, it seems to work, many many thanks
Reply With Quote
  #435  
Old 18.04.2018, 11:40
FlyAway FlyAway is offline
JD Beta
 
Join Date: Feb 2013
Posts: 51
Default

Quote:
Originally Posted by Jiaz View Post
You can modify script to check global map of reconnects done and add an additional script that always increases when reconnect is started 'Before A Reconnect' and 'After A Reconnect'. Better ask mgpai for help with this
mgpai have no time for it, but thanks for all:biggrin:
I hope that, in the future, someone can run this script because you can assign a number of executions of your choice, it could be useful in many cases
Reply With Quote
  #436  
Old 18.04.2018, 12:17
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,236
Default

@FlyAway: what exactly do you need this *number of executions* ?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #437  
Old 18.04.2018, 14:27
FlyAway FlyAway is offline
JD Beta
 
Join Date: Feb 2013
Posts: 51
Default

Quote:
Originally Posted by Jiaz View Post
@FlyAway: what exactly do you need this *number of executions* ?
I have to limit the number of reconnections because I leave the router on at night and, using the mgpai scipt, is likely to burn if it continues to reconnect for many hours
Reply With Quote
  #438  
Old 18.04.2018, 15:23
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,236
Default

you can easily modify to check last reconnect timestamp in your script
for example store timestamp last time you requested reconnect and only allow script when last reconnect is more than x mins/hours ago. should be easy to modify for mgpai
__________________
JD-Dev & Server-Admin
Reply With Quote
  #439  
Old 18.04.2018, 17:48
FlyAway FlyAway is offline
JD Beta
 
Join Date: Feb 2013
Posts: 51
Default

Quote:
Originally Posted by Jiaz View Post
you can easily modify to check last reconnect timestamp in your script
for example store timestamp last time you requested reconnect and only allow script when last reconnect is more than x mins/hours ago. should be easy to modify for mgpai
sorry I was not clear. Can you read my previous posts? There I explained well what the problem is. I think your solution is not good

Last edited by FlyAway; 18.04.2018 at 19:50.
Reply With Quote
  #440  
Old 19.04.2018, 09:24
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,236
Default

@FlyAway: Limiting the execution is about the same result as only allowing for example 2 reconnects per hour. Because with limited executions, you have to reset it manually while my solution just prevents endless/too many reconnects. You could easily mix time check and time interval check. For example between 22:00 and 06:00 only allow 2 reconnects per hours
__________________
JD-Dev & Server-Admin
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 12:25.
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.