View Single Post
  #690  
Old 13.04.2019, 12:32
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 638
Default

Quote:
Originally Posted by qayaq View Post
Unfortunately JD freezes at 100% CPU forever with this script, if there are many packages (about 3000) /downloads...
Can happen with that many links with that particular trigger. I do not have as many links in my list to test any script with alternative triggers /settings.

You can use this script to create a custom toolbar button which can be clicked to detect/disable dupes.

Code:
// Disable (instagram) links if file exists on disk
// Trigger: Toolbar Buttton Pressed
// Customaize Main Toolbar > Add a new "Eventscripter Trigger" button > Rename it to "Disable Dupes" (without quotes/case-sensitive)

if (name == "Disable Dupes") {
    getAllDownloadLinks().forEach(function(link) {
        if (!link.enabled) return;
        if (link.host != "instagram.com") return;
        if (!getPath(link.downloadPath).exists()) return;
        link.setEnabled(false);
    });
}

Code:
// Disable (instagram) links if file exists on disk
// Trigger: Toolbar Buttton Pressed
// Customaize Main Toolbar > Add New "Eventscripter Trigger" button > Rename it to "Disable Dupes" (without quotes/case-sensitive)

if (name == "Disable Dupes") {
    getAllFilePackages().forEach(function(package) {
        if (package.isFinished()) return;
        package.getDownloadLinks().forEach(function(link) {
            if (link.isFinished()) return;
            if (!link.enabled) return;
            if (link.host != "instagram.com") return;
            if (!getPath(link.downloadPath).exists()) return;
            link.setEnabled(false);
        });
    });
}

Last edited by mgpai; 15.04.2019 at 13:03. Reason: Script re-written
Reply With Quote