View Single Post
  #123  
Old 09.12.2020, 19:25
Dockel Dockel is offline
Black Hole
 
Join Date: Feb 2020
Posts: 266
Default

Quote:
From what I can see, the links are disabled only in linkgrabber tab. In downloads tab, they are skipped, not disabled.
Yes, that might be like it, I do not remember anymore, I remove the disabled links in the linkgrabber window generally.

Quote:
Can you number the scripts in your post?
Yes, in which order, numbering according to what, to a property, features, etc.? And I have lost the overview a bit because the scripts belonging to each other have become disordered because of de/activating them and such.

Quote:
I will then tell you which script I think is used to skip/enable the link.
Isn't it this one(?):

Code:
/* 
    Disable duplicate link in Lingrabber
    Trigger required: A new link has been added
*/

var link = crawledLink;

if (link.availableState == "ONLINE") {
    var name = "history";
    var lock = getModifyLock(name);

    lock.writeLock();

    var urls = getProperty(name, true);

    if (urls == null) {
        try {
            var file = JD_HOME + "/cfg/history.txt";
            var urls = readFile(file);

            setProperty(name, urls, true);
        } catch (e) {}
    }

    lock.writeUnlock();

    if (urls) {
        var url = link.contentURL || link.pluginURL;

        if (link.host == "youtube.com") {
            url = link.containerURL;
        }

        if (urls.indexOf(url) > -1) {
            var text = "#duplicatelink";
            var comment = link.comment;

            if (comment) {
                text = text + " " + comment;
            }

            link.comment = text;
            link.enabled = false;
        }
    }
}
And this one?

Code:
// Skip link if it present in download history (has "#duplicatelink" in comment)
// To download the file (prevent skipping), remove "#duplicatelink" from comment
// Trigger required: A Download Started

var comment = link.getComment() || "";

if (comment.indexOf("#duplicatelink") > -1) {
    // var url = link.getContentURL() || link.getPluginURL(); // Nur tatsächlich runtergeladene Varianten von YouTube werden als Duplikate behandelt
    var url = link.getHost() == "youtube.com" ? link.getContainerURL() : link.getContentURL() || link.getPluginURL(); // alle Varianten auf YouTube werden als Duplikate behandelt
    link.setEnabled(false); //To disable the link instead of skipping it, replace link.setSkipped(true); with link.setEnabled(false); in both the scripts
    alert("Download Skipped: \"" + url + "\" is present in history file.");
}
__________________
Aktuelles Windows
Reply With Quote