mgpai,
How do I set an event script to auto-resume partially downloaded files while JD2 is running?
Example: I have a list of 10 files in the download queue and it is simultaneously downloading one or two files, but at some point 2 or 3 of those files will have stopped at any given point with an error of "invalid download directory" so I have to manually right-click-resume and they will automatically complete successfully while JD2 is running, otherwise they will remain incomplete(partially downloaded). I think a 60-second wait is more than an ample wait-time.
So basically; set an auto-resume flag for partially downloaded non-resumable links with a 60-second wait time.
Minus the 60-sec wait, would this work?
var links = getAllDownloadLinks();
for (i = 0; i < links.length; i++) {
var link = links[i];
if (link.getBytesLoaded() == 0) link.setSkipped(true);
}
startDownloads();
Last edited by RPNet-user; 13.10.2019 at 18:16.
Reason: added script sample
|