View Single Post
Old 21.10.2020, 11:01
StarFury StarFury is offline
Modem User
Join Date: Dec 2019
Posts: 2

Thank you so much for the script, I really appreciate your help!! I just tried it and it worked for me.

I should have explained why I needed a script like this. I was looking for a way to change a file to 'Disable' when a file is not available for download, because JDownloader cannot download *some* files from this file provider I use (though the link would work in my browser if I copy/paste the link from Jdownloader2 for some reason. No big deal, I can download manually still).

But if I activate Enable Shutdown, because I want the system to shutdown after all the downloads are finished, these non-downloadable files are set to retry to download, waiting after xxx seconds, and keep retrying. And shutdown won't ever get activated because the files are still in the queue, retrying forever in a loop.

However, by Disable a file, the retry function won't get switched on. Because these files are disabled, and Enable Shutdown will work as intended after all the other files that are available, are all downloaded and finished. So that is what I was going for, and it works now, thanks for your excellent work

Originally Posted by mgpai View Post
Links with 'Temporarily unavailable' status do not use/block any download slots and as such will automatically start the next link without any user intervention. Also, if not disabled, JD will retry those links automatically when the timer ends.

In any case, here is a script which does what you requested:
    Disable links with "FILE_TEMP_UNAVAILABLE" status
    Trigger: Interval (Recommended Interval: 60000 or more)

if (isDownloadControllerRunning()) {
    getAllDownloadLinks().forEach(function(link) {
        var csr = link.conditionalSkipReason;

        if (csr) {
            var skipReason = csr.waitingSkipReason;

            if (skipReason == "FILE_TEMP_UNAVAILABLE") {
Reply With Quote