View Single Post
  #808  
Old 26.06.2019, 10:30
thecoder2012's Avatar
thecoder2012 thecoder2012 is offline
Official 9kw.eu Support
 
Join Date: Feb 2013
Location: Internet
Posts: 948
Default

Quote:
Originally Posted by Jiaz View Post
We don't want to provide access to the internal url as this can be abused or the internal url is something purely internal but I've added getPluginURL method with next core update
Sure and getPluginURL works great. Thanks!

Example "Downloads":
Code:
// Export download URLs
// Trigger : "DownloadList Contextmenu Button Pressed"
setAdvancedAlert(true);
//disablePermissionChecks();

if (name == "Export URLs") {
    if (dlSelection.getDownloadLinks().length != 0) {
        var links = dlSelection.getDownloadLinks();
        var urls = [];

        for (i = 0; i < links.length; i++) {
            var link = links[i];
            var fileName = link.getName();
            var downloadURL;
            if (/(http(s?)):\/\/|(ftp(s?)):\/\//gi.test(link.getPluginURL())) {
                downloadURL = link.getPluginURL() + "#" + fileName;
            } else {
                downloadURL = link.getContentURL() + "#" + fileName;
            }
            urls.push(downloadURL);
        }
        alert(urls.join("\r\n") + "\n");
    }
}

Example "LinkGrabber":
Code:
// Export URLs (LinkGrabber)
// Trigger : "LinkGrabber Contextmenu Button Pressed"
setAdvancedAlert(true);
//disablePermissionChecks();

if (name == "Export URLs") {
    if (lgSelection.getLinks().length != 0) {
        var links = lgSelection.getLinks();
        var urls = [];

        for (i = 0; i < links.length; i++) {
            var link = links[i];
            var fileName = link.getName();
            var lgURL;
            if (/(http(s?)):\/\/|(ftp(s?)):\/\//gi.test(link.getUrl())) {
                lgURL = link.getUrl() + "#" + fileName;
            } else {
                lgURL = link.getContentURL() + "#" + fileName;
            }
            urls.push(lgURL);
        }
        alert(urls.join("\r\n") + "\n");
    }
}

Example "See new links" (in the comment field):
Code:
// See new links (in the comment field)
// Trigger : "A new link has been added"
//setAdvancedAlert(true);
//disablePermissionChecks();

var myPLink = link;
if (/(http(s?)):\/\/|(ftp(s?)):\/\//gi.test(myPLink.getURL())) {
    myPLink.setComment(myPLink.getURL());
} else {
    myPLink.setComment(myPLink.getProperty("URL_CONTENT"));
}

Example "Get Archive Password (Downloads)" (Contextmenu):
Code:
// Get Archive Password (Downloads)
// Trigger: "DownloadList Contextmenu Button Pressed"
setAdvancedAlert(true);

if (name == "Get Archive Password") {
    if (dlSelection.getDownloadLinks().length != 0) {
        var links = dlSelection.getDownloadLinks();
        var data = "";

        for (i = 0; i < links.length; i++) {
            var link = links[i];
            var fileName = link.getName();
            var downloadURL;
            if (/(http(s?)):\/\//gi.test(link.getPluginURL())) {
                downloadURL = link.getPluginURL() + "#" + fileName;
            } else {
                downloadURL = link.getContentURL() + "#" + fileName;
            }
            var myArchive = link.getArchive();
            var passwords = "";
            var finalPassword = "";
            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 = ""
            }
            data += downloadURL + "\n" + "Passwords:" + passwords + "\nFinalPassword: " + finalPassword + "\n\n";
        }
        alert(data);
    }
}

Example "Speedtest":
Code:
// Add downloadlinks as speedtest
// Trigger: Main Menu Button Pressed (Schaltfläche Hauptmenü betätigt)
// Triggername: Speedtest

if (name == "Speedtest") {
    var dlURL = [];

    dlURL.push("http" + "://cdn8.appwork.org/speed.zip");
    // speed.hetzner.de
    dlURL.push("https" + "://speed.hetzner.de/100MB.bin");
    dlURL.push("https" + "://speed.hetzner.de/1GB.bin");
    dlURL.push("https" + "://speed.hetzner.de/10GB.bin");
    // ovh.net/files/
    dlURL.push("http" + "://www.ovh.net/files/1Mb.dat");
    dlURL.push("http" + "://www.ovh.net/files/10Mb.dat");
    dlURL.push("http" + "://www.ovh.net/files/100Mb.dat");
    dlURL.push("http" + "://www.ovh.net/files/1Gb.dat");
    dlURL.push("http" + "://www.ovh.net/files/10Gb.dat");
    // speedtest.tele2.net
    dlURL.push("http" + "://speedtest.tele2.net/1MB.zip");
    dlURL.push("http" + "://speedtest.tele2.net/10MB.zip");
    dlURL.push("http" + "://speedtest.tele2.net/100MB.zip");
    dlURL.push("http" + "://speedtest.tele2.net/1GB.zip");
    dlURL.push("http" + "://speedtest.tele2.net/10GB.zip");
    dlURL.push("http" + "://speedtest.tele2.net/100GB.zip");
    dlURL.push("http" + "://speedtest.tele2.net/1000GB.zip");
    // speedtest.serverius.net
    dlURL.push("http" + "://speedtest.serverius.net/files/10mb.bin");
    dlURL.push("http" + "://speedtest.serverius.net/files/100mb.bin");
    dlURL.push("http" + "://speedtest.serverius.net/files/1000mb.bin");
    dlURL.push("http" + "://speedtest.serverius.net/files/2000mb.bin");
    dlURL.push("http" + "://speedtest.serverius.net/files/5000mb.bin");
    dlURL.push("http" + "://speedtest.serverius.net/files/10000mb.bin");
    // mirror.nl.leaseweb.net/speedtest
    dlURL.push("http" + "://mirror.nl.leaseweb.net/speedtest/10mb.bin");
    dlURL.push("http" + "://mirror.nl.leaseweb.net/speedtest/100mb.bin");
    dlURL.push("http" + "://mirror.nl.leaseweb.net/speedtest/1000mb.bin");
    dlURL.push("http" + "://mirror.nl.leaseweb.net/speedtest/10000mb.bin");
    // mirror2.netcologne.de
    dlURL.push("http" + "://mirror2.netcologne.de/10g.bin");
    dlURL.push("http" + "://mirror2.netcologne.de/1gb.bin");
    // speedtest.belwue.net/http-dl.html
    dlURL.push("http" + "://speedtest.belwue.net/random-100M");
    dlURL.push("http" + "://speedtest.belwue.net/random-1G");
    dlURL.push("http" + "://speedtest.belwue.net/10G");
    dlURL.push("http" + "://speedtest.belwue.net/100G");
    dlURL.push("http" + "://speedtest.belwue.net/1000G");
    // www.speedtestx.de (captcha required)
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_1mb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_10mb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_100mb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_256mb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_500mb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_1gb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_5gb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_100mb_compressable.test");


    callAPI("linkgrabberv2", "addLinks", {
        "deepDecrypt": false,
        "packageName": "Speedtest",
        "links": dlURL.join("\r\n")
    });

}
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep.

Last edited by thecoder2012; 22.07.2019 at 09:07.
Reply With Quote