JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1041  
Old 20.12.2019, 06:05
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by DieKatzchen View Post
Is there a way, using some combination of scripts and/or packagizer rules to convert the URL to a full path, e.g. **External links are only visible to Support Staff**... becomes C:\myfolder\foo\bar\file.zip? I almost had it with packagizer rules but it turned all the / into _ which is not what I want.
You will need to create multiple rules to capture each of the folders in the url separately (without '/'). Check this topic for more information/example.

The URL which you have posted is only visible to the staff members. Please find me in JD Chat if you need a solution using eventscripter.
Reply With Quote
  #1042  
Old 13.01.2020, 12:29
platz
Guest
 
Posts: n/a
Default Link removal or reset for specific host

Can somoneone help me with setting up a script for a specific hoster?
For host "x.com"
  1. If status is "File already exists" remove link from JD
  2. If status is "Try restarting this link (plugin outdated?)" or "File not found" reset the link

Thank you in advance!
Reply With Quote
  #1043  
Old 15.01.2020, 00:06
ITPhoneHome
Guest
 
Posts: n/a
Default

As in post https://board.jdownloader.org/showpo...postcount=1015 can the Downloads be reset with a script to "Reset" after they are downloaded so I can download them again with the scheduler using 30 minute intervals? Now I have to right click all downloads and choose "Other" then "Reset" then the scheduler works.
Thanks!
Reply With Quote
  #1044  
Old 15.01.2020, 09:55
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by ITPhoneHome View Post
... can the Downloads be reset with a script to "Reset" after they are downloaded so I can download them again with the scheduler using 30 minute intervals?
Can you provide some example links (via email or JD Chat)?
Reply With Quote
  #1045  
Old 15.01.2020, 10:37
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by platz View Post
... script for a specific hoster?
If status is "File already exists" remove link from JD
Code:
// Remove download link, if file exists on disk
// Trigger : A Download stopped

var myHosts = ["example.com", "site.com", "demo.com"];

var host = link.getDownloadHost();
var finalStatus = link.getFinalLinkStatus();

if (myHosts.indexOf(host) > -1 && finalStatus == "FAILED_EXISTS") link.remove();

Quote:
Originally Posted by platz View Post
If status is "Try restarting this link (plugin outdated?)" or "File not found" reset the link
Using script for this can result in an infinite loop. If you provide the logs, the developers might be able to check and fix it at the plugin level.
Reply With Quote
  #1046  
Old 18.01.2020, 18:44
söny
Guest
 
Posts: n/a
Default

Hi, the MP3 scripct at the beginning of this topic does not work for me. what am I doing wrong?
Reply With Quote
  #1047  
Old 18.01.2020, 19:10
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by söny View Post
Hi, the MP3 scripct at the beginning of this topic does not work for me. what am I doing wrong?
Make sure you have used the correct trigger (A Download Stopped). The default setting will only convert aac,m4a and ogg files.

If you need help with troubleshooting, you can find me in JD Chat.

Code:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader
Reply With Quote
  #1048  
Old 18.01.2020, 19:49
söny
Guest
 
Posts: n/a
Default

it works now. the save button was hidden. However thank you for your help.
Reply With Quote
  #1049  
Old 29.01.2020, 10:32
ElCho ElCho is offline
Black Hole
 
Join Date: May 2014
Posts: 277
Default

Hello, I would please need a script which fixes the faulty status of some "Zippyshare" downloads (usually just one) that get stuck every now and then, blocking the "shutdown extension" and, consequently, making my PC stays on all the time just because one or two incomplete files. The problem's details over here:

https://board.jdownloader.org/showthread.php?t=82780

I think a script doing this would fix the issue:

While the download process is active, if there is a "temporarily unavailable" (with a 30' counter) message, or a ""Retry in 15..." one (), make it "stops" (Ctrl+S) the whole process and "starts" (Ctrl+S) it again; in case the same messages (or even some other one which implies the download can't be accomplished) repeat the same step three times. If none of the three previous attempts didn't work, make it "stops" (Ctrl+S) the whole process, "resets" the specific file and "starts" (Ctrl+S) it again. Finally, if the download still fails after being reset, make it "stops" (Ctrl+S) the whole process, which should let the "shutdown extension" trigger the sleeping task.

If there is more than one faulty file, the script should process each of them sequentially, and trigger the "shutdown extension" only after the last one was analyzed.

Thanks.

Last edited by ElCho; 29.01.2020 at 10:38.
Reply With Quote
  #1050  
Old 29.01.2020, 18:24
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by ElCho View Post
... a script which fixes the faulty status of some "Zippyshare" downloads (usually just one) that get stuck every now and then, blocking the "shutdown extension" and, consequently, making my PC stays on all the time just because one or two incomplete files ...
The status message available to the script will be different than the one displayed in GUI. To be able to create/test a script based on status messages, one should be able to access it. I may not be able to do so, since I rarely download from that hoster. Even if I did for testing purposes, It might not be easy to trigger those exact messages. If you are familiar with Javascript, I can offer you my assistance (if required) to create one.

Alternatively, you might be able to achieve the same result with the following script. It will skip/restart (or reset, depending on if any data has been downloaded for that link) failed downloads as long as other downloads are active. In the event they do not start during that period, they will remain skipped and allow the extension to shutdown the system.

Code:
// Skip/Unskip (or reset) unfinished downloads from user-spcified hosters
// Trigger: A download stopped

var myHosts = ["example.com", "demo.com,", "zippyshare.com"]; // <- Process links only from these hosters

if (link.isFinished()) {
    getAllDownloadLinks().filter(function(link) {
        if (link.isFinished()) return;
        if (myHosts.indexOf(link.getHost()) == -1) return;
        if (!link.isSkipped()) return;
        if (link.getSkippedReason() != "MANUAL") return;
        if (link.getBytesLoaded()) link.setSkipped(false);
        if (!link.getBytesLoaded()) link.reset();
    })
}

if (!link.isFinished() && myHosts.indexOf(link.getHost()) > -1) {
    link.setSkipped(true);
}

Last edited by mgpai; 29.01.2020 at 18:28.
Reply With Quote
  #1051  
Old 30.01.2020, 09:56
ElCho ElCho is offline
Black Hole
 
Join Date: May 2014
Posts: 277
Default

I just tried that script with a new downloads' batch, and despite there was one of those faulty incomplete downloads, nothing happened. I imported it "as is" into JD2's even scripter and make it active; maybe because it didn't get a correct "trigger"? I set it as "interval", since after importing it, there was no one.

What I just realized, is that when that ""temporarily unavailable" message start appearing, for some weird reason JD2 doesn't even try a new attempt but it just "reset" the time counter only. When I come back to the PC, I just stop the downloading process and start it again, and then the files get completed. So, I'm still kind of sure it has to be with some JD2's specific glitch.

I'm still able to replicate the error messages using some faulty download links, and have some basic Java knowledge, so in case you want to create that script I mentioned before, I could set up a VM, if needed.
Reply With Quote
  #1052  
Old 30.01.2020, 10:28
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by ElCho View Post
I just tried that script nothing happened. I imported it "as is" into JD2's even scripter and make it active; maybe because it didn't get a correct "trigger"? I set it as "interval", since after importing it, there was no one.
The script requires "A Download Stopped" trigger (which has been specified in the script).
Code:
// Trigger: A download stopped

It is not set automatically. You have to manually select it from the drop-down menu of "Trigger" column in the script list in eventscripter panel.

You can find me in JD Chat, if you need any help setting it up.
Code:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader
Reply With Quote
  #1053  
Old 31.01.2020, 03:50
ElCho ElCho is offline
Black Hole
 
Join Date: May 2014
Posts: 277
Default

Earlier today I left JD2 downloading using the script with the needed trigger, and after returning
I encountered the system was still on, so the shutdown extension wasn't executed. The weird thing is,
the downloads were all completed but the script itself failed, since there were a few error messages:



As well as this error message window, whose there were around "50" of them:



They were shown at the same time, and right after I closed them, three of teh downloads were marked as "completed", as if they were just finished, although I'm afraid they were already downloaded. The script got disabled after that.

Last edited by ElCho; 31.01.2020 at 04:07.
Reply With Quote
  #1054  
Old 31.01.2020, 06:36
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by ElCho View Post
... the script itself failed, since there were a few error
It appears that a '}' (curly bracket) is missing from your script. Compare your script with the one posted in the forum and make the necessary changes to it, or delete all scripts from the eventscripter and paste the one my earlier post and try again.
Reply With Quote
  #1055  
Old 01.02.2020, 00:29
ElCho ElCho is offline
Black Hole
 
Join Date: May 2014
Posts: 277
Default

I finally could try it, but so far I found two issues:

1 - It triggers the "skipped" status, which hasn't the same outcome as when I manually do the "stop/start" sequence manually. Skipping will not even do a single retry on the faulty file.

2 - It is too "sensitive" so to speak, in the sense that it triggers the "skipped" state too quickly; sometimes even without reaching %0,10 progress.

Thanks.
Reply With Quote
  #1056  
Old 01.02.2020, 06:07
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by ElCho View Post
1 - It triggers the "skipped" status, which hasn't the same outcome as when I manually do the "stop/start" sequence manually. Skipping will not even do a single retry on the faulty file.
Only links with errors like 'connection problems' and 'temporarily not available' can be retried with 'stop/start' sequence. Others can be started only when the countdown timer ends, in other words not soon after it has been skipped. All downloads which can be retried with 'stop/restart' action can also be started with 'skip/unskip' action, because 'skipping' a download will essentially 'stop' the download.

'unskip' is only used on partially downloaded files. Links where no data has yet been downloaded will be 'reset'. Unlike 'unskip' it will definitely try to start the download during the next attempt.

Quote:
Originally Posted by ElCho View Post
2 - It is too "sensitive" so to speak, in the sense that it triggers the "skipped" state too quickly; sometimes even without reaching %0,10 progress.
How fast the link is skipped will depend on how fast the download has stopped, over which the script has not control. In other words, the download would have stopped even if the script did not skip it. Irrespective of when or how soon it's been skipped, it will only be retried when the next download is finished. And it will keep doing that with all failed downloads till the last successful download has stopped. You can also modify the script to suit your need by using the methods listed in the built-in help.

As mentioned in the chat room, you may not even need to use the script. Just using less than 20 chunks per download might also most likely solve the issue. Jiaz has noted that other users haven't reported similar issue with that host. It is quite likely due to using less chunks.
Reply With Quote
  #1057  
Old 01.02.2020, 06:52
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,674
Default

I kinda hinted at chunking, jd core is not good with many chunks. slighest issue with one of the connection all the good ones are terminated, and download is restarted just to resume one of the broken connections.

Also note that zippy used to fight us bad, and plugin isn't designed to give good error feedbacks. its all set to wait, which I didn't allude to before, which is probably the issue for never giving up. That said script solution might not be required if you use less chunks assuming that the issue is that and not javascript trickery.
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #1058  
Old 06.02.2020, 17:05
leotzian leotzian is offline
Registered / Inactive
 
Join Date: Jun 2018
Posts: 6
Default

Hi to all a liitle help please, I have a synology nas with jdownloader package installed, is there a way when a file had finished the nas sent me an email that the file was finished? I had read about a script but I cannot find if is this possible.
The download synology package can do that but jdownloader is much much better.
Thank you in advance.
Reply With Quote
  #1059  
Old 06.02.2020, 17:16
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by leotzian View Post
... is there a way when a file had finished the nas sent me an email that the file was finished? I had read about a script but I cannot find if is this possible.
If you are able to send it via CLI, you can call the same command in JD eventscripter. Check Post #464 to Post #470.
Reply With Quote
  #1060  
Old 06.02.2020, 17:41
leotzian leotzian is offline
Registered / Inactive
 
Join Date: Jun 2018
Posts: 6
Default

Quote:
Originally Posted by mgpai View Post
If you are able to send it via CLI, you can call the same command in JD eventscripter. Check **External links are only visible to Support Staff**....
Hi my friend thanks for the answer I had found the below 2 scripts in post #469 but I don't know how to use them, do I need the sentmail app or else, I you know to help me more, I must use both?
Thanks in advance

github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/desperado591.js
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/desperado591_2.js
Reply With Quote
  #1061  
Old 06.02.2020, 18:22
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by leotzian View Post
... I had found the below 2 scripts in post #469 but I don't know how to use them, do I need the sentmail app or else, I you know to help me more, I must use both?
I think you have to configure 'sendmail' in synolgy. I am not sure though.

As far as the scripts are concerned, one will send an email when download is finished and other one when extraction is finished. You can use either or both.

To use the script you need to install/enable eventscripter extension in JD. Install and test the scripts in a JD install with GUI and then copy the contents or the file "org.jdownloader.extensions.eventscripter.EventScripterExtension.scripts.json' to the headless install. The JSON file will be located in the 'cfg' folder.
Reply With Quote
  #1062  
Old 07.02.2020, 09:44
leotzian leotzian is offline
Registered / Inactive
 
Join Date: Jun 2018
Posts: 6
Default

Hi my friend again I am trying to make this work, first question in the below script

// Send email notification (NAS)
// Trigger Required: A Download Stopped
// Important: Enable "Synchronous execcution" checkbox in top panel

if (link.isFinished()) {
var absender = "nas@domain.de";
var empfaenger = "empfaenger@domain.de";
var inhalt = getPath(JD_HOME + "/link - inhalt.txt");

writeFile(inhalt, "Link Finished: " + link.getName(), true);
callSync("sendmail", "-F", absender, "-t", empfaenger, "<", inhalt);
deleteFile(inhalt, false);
}

I change only the text inside the quotes with my sender email in
var absender = "nas@domain.de";
and the reciever email in
var empfaenger = "empfaenger@domain.de";

nothing else? I managed to install event scripter in JD in my nas and activate it and activate and the script, but it is not working.
I tried to ssh to the nas the sentmail command but I have the response
sentmail: command not found, so I must search the net what else to do in my nas to activate sentmail ..... it seems difficult to me, I don't want to bother you any more...
Thank you very much for the help I don't know if anyone in this forum that had managed to make this work to help a little.

Edit

I had made an improvement I managed to get sentmail command to work, I had to install mailserver package in synology and configuring it.
Now when download is finished I recieve an email in my spam folder without subject and without body
But if I run a script within my synology task manager with the following format email has title body subject and it goes in my inbox perfect, the format is the below

sendmail -F "Synology Station" -f "sender@here.com" -t reciever@herere.com << EOF
Subject: Synology Mail Test
All working fine.
EOF


Is it easy for you to convert the above jdownloader script to this format I had not know how...

Thanks in advance.

Last edited by leotzian; 07.02.2020 at 10:59.
Reply With Quote
  #1063  
Old 07.02.2020, 11:02
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by leotzian View Post
I tried to ssh to the nas the sentmail command but I have the response
sentmail: command not found, so I must search the net what else to do in my nas to activate sentmail ...
Check the synology forum for articles/tutorials on how to configure email server. The script will work only if you are able to send email via CLI. It is very likely other are sending email notifications via eventscripter.
Reply With Quote
  #1064  
Old 07.02.2020, 14:28
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by leotzian View Post
sendmail -F "Synology Station" -f "sender@here.com" -t reciever@herere.com << EOF
Subject: Synology Mail Test
All working fine.
EOF


Is it easy for you to convert the above jdownloader script to this format I had not know how...
I man not familiar with linux commands. Use following method to run terminal commands from script:

Method:
Code:
var myString = callSync(myString[]);/*Call a local Process. Blocks Until the process returns*/
/* Example: */var pingResultString = callSync("ping","jdownloader.org");

I am guessing something like this may work:
Code:
callSync("sendmail", "-F", "\"Synology Station\"", "-f", "\"sender@here.com\"", "-t", "reciever@herere.com", "<<", "EOF", "\r\nSubject: Synology Mail Test\r\nAll working fine.\r\n", "EOF");

Also, I am not sure how linux handles "\r\n".
Reply With Quote
  #1065  
Old 07.02.2020, 15:24
leotzian leotzian is offline
Registered / Inactive
 
Join Date: Jun 2018
Posts: 6
Default

I CAN sent emails via CLI, but I cannot make the script in Jdownloader to work, email IS sent but goes to spam it has no title, body and subject.
Your suggestion is not working.
I will search synology forums for help, now with your help I know what to search for.
Thanks for your help.
Reply With Quote
  #1066  
Old 07.02.2020, 16:55
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by leotzian View Post
I CAN sent emails via CLI, but I cannot make the script in Jdownloader to work, email IS sent but goes to spam it has no title, body and subject.
I had created those scripts based on the information provide in this link:
Code:
mkleine.de/blog/2016/01/07/synology-sendmail-per-shell-aktivieren/

English version:
Code:
// Send email notification (NAS)
// Trigger Required: A Download Stopped
// Important: Enable "Synchronous execcution" checkbox in top panel

if (link.isFinished()) {
    var sender = "sender@here.com";
    var receiver = "reciever@herere.com";
    var message = getPath(JD_HOME + "/download finished notification.txt");

    writeFile(message, "Link Finished: " + link.getName(), true);
    callSync("sendmail", "-F", sender, "-t", receiver, "<", message);
    deleteFile(message, false);
}

In this case the message body is first written to a temp file and then passed to the call. I guess it might also be possible to include the subject in it.
Reply With Quote
  #1067  
Old 08.02.2020, 11:45
leotzian leotzian is offline
Registered / Inactive
 
Join Date: Jun 2018
Posts: 6
Default

Quote:
Originally Posted by mgpai View Post
I had created those scripts based on the information provide in this link:
Code:
mkleine.de/blog/2016/01/07/synology-sendmail-per-shell-aktivieren/

English version:
Code:
// Send email notification (NAS)
// Trigger Required: A Download Stopped
// Important: Enable "Synchronous execcution" checkbox in top panel

if (link.isFinished()) {
    var sender = "sender@here.com";
    var receiver = "reciever@herere.com";
    var message = getPath(JD_HOME + "/download finished notification.txt");

    writeFile(message, "Link Finished: " + link.getName(), true);
    callSync("sendmail", "-F", sender, "-t", receiver, "<", message);
    deleteFile(message, false);
}

In this case the message body is first written to a temp file and then passed to the call. I guess it might also be possible to include the subject in it.
Hi my friend thanks for help
I tested your script it is not working, I don't want what is going on, I tried with other email adress
Download is finished at once an email is sent from the sender's email, to the recievers inbox BUT ir had not Title subject or Body only From to .
In my nas had installed from community repo the only version they have look the photo attachment, also If I olen from the nas the file created by the script
org.jdownloader.extensions.eventscripter.EventScripterExtension.scripts.json
usinf text edidor the format is not the same as the original script is this normal?

[ {
"eventTrigger" : "ON_DOWNLOAD_CONTROLLER_STOPPED",
"enabled" : true,
"name" : "Event Script",
"script" : "// Send email notification (NAS)\n// Trigger Required: A Download Stopped\n// Important: Enable "Synchronous execcution" checkbox in top panel\n\nif (link.isFinished()) {\n var sender = "sender@gmail.com";\n var receiver = "reciever@otenet.gr";\n var message = getPath(JD_HOME + "/download finished notification.txt");\n\n writeFile(message, "Link Finished: " + link.getName(), true);\n callSync("sendmail", "-F", sender, "-t", receiver, "<", message);\n deleteFile(message, false);\n}\n",
"eventTriggerSettings" : { },
"id" : 1581153863487
} ]

Perhaps a bug in the NAS version of JDownloader?
Attached Thumbnails
Jdownloader.jpg  
Reply With Quote
  #1068  
Old 08.02.2020, 12:05
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by leotzian View Post
Download is finished at once an email is sent from the sender's email, to the recievers inbox BUT ir had not Title subject or Body only From to
You can try sending static messages for testing. Also, I think the templated which I provided does not include a 'subject'. If you need any help troubleshooting you can contact me in JD Chat. I am currently online there:

Code:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader
Reply With Quote
  #1069  
Old 10.02.2020, 03:59
ElCho ElCho is offline
Black Hole
 
Join Date: May 2014
Posts: 277
Default

Quote:
Originally Posted by mgpai View Post
Only links with errors like 'connection problems' and 'temporarily not available' can be retried with 'stop/start' sequence. Others can be started only when the countdown timer ends, in other words not soon after it has been skipped. All downloads which can be retried with 'stop/restart' action can also be started with 'skip/unskip' action, because 'skipping' a download will essentially 'stop' the download.

'unskip' is only used on partially downloaded files. Links where no data has yet been downloaded will be 'reset'. Unlike 'unskip' it will definitely try to start the download during the next attempt.



How fast the link is skipped will depend on how fast the download has stopped, over which the script has not control. In other words, the download would have stopped even if the script did not skip it. Irrespective of when or how soon it's been skipped, it will only be retried when the next download is finished. And it will keep doing that with all failed downloads till the last successful download has stopped. You can also modify the script to suit your need by using the methods listed in the built-in help.

As mentioned in the chat room, you may not even need to use the script. Just using less than 20 chunks per download might also most likely solve the issue. Jiaz has noted that other users haven't reported similar issue with that host. It is quite likely due to using less chunks.
Hello, I'd been trying the script a little bit more and it has been working fine so far, but I'm wondering about two things:

1- Does it necessarily have to wait for a successfully completed download to trigger the "skip/unskip" sequence? I mean, in the case there aren't no new downloads to start but they all were already put into a "skipped" condition, couldn't it just wait a few seconds, and then retry over those?

2- Something weird happened with the last downloads' batch I left, since despite there was still a pending download, the system was put to sleep:



3- Could the script "skipping" action be triggered not right after after it detects a problem was found with one of the connections, but
just after its third time doing that? So, that way it lets JD2 retry by itself at least three times, thus avoiding skipping right away downloads which
can be resumed correctly after a few attempts. Or maybe, triggering the "skipping" condition only "1" minute after a determined download was put into
a "waiting" or a "stopped" state.

As I told you before in private, I played a little bit with less connections/chunks, but doing it that way would suppose wasting available bandwidth
and, consequently, more time.

Last edited by ElCho; 10.02.2020 at 04:07.
Reply With Quote
  #1070  
Old 10.02.2020, 07:01
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Does it necessarily have to wait for a successfully completed download to trigger the "skip/unskip" sequence? I mean, in the case there aren't no new downloads to start but they all were already put into a "skipped" condition, couldn't it just wait a few seconds, and then retry over those?
As I have alread stated before, some downloads can be started only after the wait time is over. If you want the download to start immediately you have to reset them, instead of resuming them. Simply retrying/resuming them every few seconds will not help in any way.

Quote:
Something weird happened with the last downloads' batch I left, since despite there was still a pending download, the system was put to sleep:
If the download could not be retried/resumed, it will be remain skipped in order to allow the extension to shut down. That is the purpose of this script.

Quote:
Could the script "skipping" action be triggered not right after after it detects a problem was found with one of the connections, but
just after its third time doing that? So, that way it lets JD2 retry by itself at least three times, thus avoiding skipping right away downloads which
can be resumed correctly after a few attempts. Or maybe, triggering the "skipping" condition only "1" minute after a determined download was put into
a "waiting" or a "stopped" state.
The script does not 'decide' when to skip the download. It is skipped only after the download has stopped. Even if it was not skipped, it will not be retried immediately. It will only be retried by JD after the waittime is over.

The script I have provided does not limit the number of retries, so I don't see any benefit with the system you have suggested. You can always modify the existing script or create a new one to come up with a solution which is acceptable to you. All available methods are listed in the Help menu.

Quote:
As I told you before in private, I played a little bit with less connections/chunks, but doing it that way would suppose wasting available bandwidth
and, consequently, more time.
In my opinion, 320 (16 *20) connections will rarely, if ever, be required to saturate the bandwidth.

The best solution to this problem is to prevent connection issues, either by using less total connections or using the 'automax' advanced setting option, to start new downloads till the bandwidth is saturated.
Reply With Quote
  #1071  
Old 10.02.2020, 11:07
ElCho ElCho is offline
Black Hole
 
Join Date: May 2014
Posts: 277
Default

Quote:
As I have alread stated before, some downloads can be started only after the wait time is over. If you want the download to start immediately you have to reset them, instead of resuming them. Simply retrying/resuming them every few seconds will not help in any way.
Yes I know, but since the script omits the error messages with a timer on them, I was wondering whether the downloads could be retried immediately or not; or even be reset if a given amount of retries attempts failed.

Quote:
If the download could not be retried/resumed, it will be remain skipped in order to allow the extension to shut down. That is the purpose of this script.
I didn't know that, and although I don't know how many retries it would take, it makes sense it behaves like that so the system doesn0t keep idling (which is the main issue I'm trying to avoid).

Quote:
The script does not 'decide' when to skip the download. It is skipped only after the download has stopped. Even if it was not skipped, it will not be retried immediately. It will only be retried by JD after the waittime is over.

The script I have provided does not limit the number of retries, so I don't see any benefit with the system you have suggested. You can always modify the existing script or create a new one to come up with a solution which is acceptable to you. All available methods are listed in the Help menu.
All the skipped downloads I saw so far were started right after another currently active download was successfully completed. And before using the script, I usually saw how JD2 did a few retries attempts for problematic downloads; some of them were carried successfully after that, and others were given the message with a timer on it (5'/15'/30').

Anyway, since my original intention was and still is to avoid the system keeps idling just because every now and then one or two files get a looping timer, I think the current script although not perfect, aids in that sense. An ideal one would simply limit to do what I manually do whenever I find a download in such a state, but I know of the message's related limitation.

Regarding the connection performance, I know it is a high amount of connections, but after doing some tests, I noted that if I use a smaller amount, the bandwidth will certainly not be maximized in a constant way, till all downloads are completed.

Anyway, I will try that "automax" feature you mentioned.

Thanks.
Reply With Quote
  #1072  
Old 14.02.2020, 15:11
Heinz Heinz is offline
JD Alpha
 
Join Date: Feb 2020
Posts: 21
Default

Hi there,

new to jd scripting and need a little help. Im trying to check to which proxy a download is connected and if a condition is met, to disable/enable that proxy.

Additionally changing the proxys priority would also be helpful.

Are there such methods? couldn't find any in the documetation.
How could this be implemented?

Code:
var running = getRunningDownloadLinks();

for (i = 0; i < running.length; i++) {
	var download = running[i];
	
	//get connected proxy
	Proxy proxy = download.getProxy();
	//if condition meets disable
	proxy.setDisabled(true);
	//or if condition meets change priority
	proxy.setPriority(Priority.MAX);
}
Reply With Quote
  #1073  
Old 14.02.2020, 17:14
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by Heinz View Post
... Im trying to check to which proxy a download is connected and if a condition is met, to disable/enable that proxy.

Additionally changing the proxys priority would also be helpful ...
There are no methods which return connection details of a download. There are also no methods or any setting which can be used to assign prioirty to proxies

It is possible to enable/disable/remove the proxy using the 'config' namespace of MYJD API. You can create a event based or interval based script, which can test the proxies in the list and enable/disable/remove them from the it.

There is also a method in eventscripter API, which returns 'banned' proxies, which might be of help to identify problematic proxies. Connections details are also logged in some files which can be found in 'JD\logs' folder, but parsing them might not be very convenient or practical.

By default JD uses the connections in the order they appear in the list. An alternative to priority might be to arrange them in the order of your preference.

You can set/change the proxy selection mode in "GeneralSettings.freeproxybalancemode" (Advanced Setting).
Reply With Quote
  #1074  
Old 14.02.2020, 17:49
Heinz Heinz is offline
JD Alpha
 
Join Date: Feb 2020
Posts: 21
Default

Quote:
Originally Posted by mgpai View Post
There are no methods which return connection details of a download. There are also no methods or any setting which can be used to assign prioirty to proxies....
Ok, thanks for your reply!

Another approach to solve the problem:

I know we can ckeck if a Proxy is up by using the getPage method in a try catch blog.

But is it possible in any way to measure the transfer speed of the proxy in a simple way?

Code:
//Is proxy up
var browser = getBrowser();
browser.setProxy(...);
browser.getPage("http://www.google.com");

//Is proxy fast
var browser = getBrowser();
browser.setProxy(...);
int time = browser.getLoadTime("http://www.google.com");
if(time....
Reply With Quote
  #1075  
Old 14.02.2020, 17:58
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by Heinz View Post
But is it possible in any way to measure the transfer speed of the proxy in a simple way?
Does this help? :
Code:
var startTime = new Date();
var page = getPage("http://www.google.com");
var endTime = new Date();
var loadTime = endTime - startTime;

alert(loadTime);
Reply With Quote
  #1076  
Old 14.02.2020, 19:37
Heinz Heinz is offline
JD Alpha
 
Join Date: Feb 2020
Posts: 21
Default

Quote:
Originally Posted by mgpai View Post
Does this help? :
Yes!! Thanks!
Reply With Quote
  #1077  
Old 16.02.2020, 15:41
leotzian leotzian is offline
Registered / Inactive
 
Join Date: Jun 2018
Posts: 6
Default JD2 and Synology NAS email Sent after Download Finished

Hi to all I open a new thread if anyone has found a solution to this I had searched a lot but I could not find a person who had managed to solve this issue.

I had tried with @mgpai hours in the chat to solve the task I want, I don't know If you have any idea of that.
I want when JD finished a download to sent me an email.
I had installed mail server in the nas that installs postfix sendmail command.
I had managed to get email sent with commands using sunology CLI but the same commands using script manager are not working.
The command that it is working is
sendmail -vt < /mail.txt in mail.txt I have the format
===================
To: reciever@otenet.gr
Subject: JDownloader Downloads
From: sender@gmail.com

Body of the message
====================
This command sents an email with sender reciever in recievers mailbox, with subject and body.

With @mgpai he managed to create the txt file filled with the correct data of the downloaded file ( subject and file details ).
When I run this command using CLI of synology ssh it is working fine
If I make a script with this command in Task scheduler of my nas it is working ok, BUT if I try to add THE SAME COMMAND using script in event scripter, WE had tried 1000 compinations with /r/n etc or different syntax , it is not working, The command cannot access the mail.txt file and the "<" symbol is not recognised.
I had tried to store the mail.txt in several locations with the same result.
I don't if it permision issue.
I had installed JD through the synology community repo through the package manager in my NAS
Do you have any ideas where to look for or what to do?
Another format that is working using CLI is

sendmail -F "Synology DS416Play" -f "sender@gmail.com" -t "reciever@otenet.gr"
Subject: JDownloader Downloads
Download had been finished
EOF

In the CLI I have to press enter after each line but in the script /r/n/ commands are not recognized as line feed or carriage return, by my nas and in the mail server log it seams that I have emails to recievers like - Subject ,Jdownloader,Downloads EOF etc
Very crazy though

If anyone who owns a Synology NAS had managed to make this work please a little help please.

Thanks in advance and sorry for the big post.
Reply With Quote
  #1078  
Old 17.02.2020, 21:29
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 73,512
Default

Merged EventScripter threads.

@leotzian
Your issue is a script issue but not a general JDownloader issue/bug.

Please keep in mind that we do not provide support for individual scripts - they are NOT in any way official parts of our application!
You will have to rely on other users to help you with this.

-psp-
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #1079  
Old 18.02.2020, 21:06
RPNet-user's Avatar
RPNet-user RPNet-user is offline
Tornado
 
Join Date: Apr 2017
Posts: 237
Default

@mgpai

Is it possible via one of the triggers to have a script automatically crawl and fetch RapidRar(RR) links from the rmz.cr main page matching '1080p VXT' or '1080p RARBG' in the title name and add those links to the linkgrabber queue or a text file and start only from the current date for newly posted titles that match either keyword set?

Code:
**External links are only visible to Support Staff**
Reply With Quote
  #1080  
Old 19.02.2020, 06:42
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,635
Default

Quote:
Originally Posted by RPNet-user View Post
Is it possible via one of the triggers to have a script automatically crawl and fetch RapidRar(RR) links from the rmz.cr main page matching '1080p VXT' or '1080p RARBG' in the title name and add those links to the linkgrabber queue or a text file and start only from the current date for newly posted titles that match either keyword set?
You can use a script to add the 'source url' to JD at regular intervals. If JD does not find any links, you will need to create linkcrawler rules. Specify 'deeppattern' to grab only those links which match your keyword. If the links are grabbed automatically (without using linkcrawler rule), use the linkgrabber filter rule to block links which do not match your keyword.

Related Script: Post #1002
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 04:23.
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.