View Single Post
  #3  
Old 22.07.2019, 08:26
thecoder2012's Avatar
thecoder2012 thecoder2012 is offline
Official 9kw.eu Support
 
Join Date: Feb 2013
Location: Internet
Posts: 1,289
Default

Quote:
Originally Posted by skirtmen View Post
Links bzw. Pakete die sich schon in der Download-Sektion befinden
wieder zurück in die Linksammler-Sektion zu verschieben ?
Es wäre auch mit dem Ereignis-Skripter denkbar als Workaround.

Beispiel:
Code:
// Downloads2linkgrabber
// Trigger: "DownloadList Contextmenu Button Pressed" (Schaltfläche im Download-Konextmenü bestätigt)
// Triggername: LinkGrabber

if (name == "LinkGrabber") {
    var links = dlSelection.getDownloadLinks();
    for (i = 0; i < links.length; i++) {
        var link = links[i];
        var downloadURL;
        if (/(http(s?)):\/\//gi.test(link.getPluginURL())) {
            downloadURL = link.getPluginURL();
        } else {
            downloadURL = link.getContentURL();
        }

        var myArchive = link.getArchive();
        var passwords = "";
        var finalPassword = "";
        var downloadPassword = "";
        if (link.getArchive()) {
            if (myArchive.getInfo().hasOwnProperty("passwords")) {
                passwords = myArchive.getInfo().passwords;
            }
            if (myArchive.getInfo().hasOwnProperty("finalPassword")) {
                finalPassword = myArchive.getInfo().finalPassword;
            }
        }
        if (finalPassword == null) {
            finalPassword = "";
        }
        if (passwords == null) {
            passwords = "";
        }
        if (finalPassword == "") {
            finalPassword = passwords;
        }
        if (link.getProperty("pass") != null) {
            downloadPassword = link.getProperty("pass");
        }

        if (downloadURL) {
            callAPI("linkgrabberv2", "addLinks", {
                "assignJobID": true,
                "deepDecrypt": false,
                "packageName": link.getPackage().getName(),
                "autostart": false,
                "autoExtract": true,
                "priority": "DEFAULT",
                "extractPassword": finalPassword,
                "downloadPassword": downloadPassword,
                "destinationFolder": link.getDownloadPath().substr(0, link.getDownloadPath().lastIndexOf('/')),
                "links": downloadURL
            });
            link.remove();
        }
    }
}
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep.
Reply With Quote