View Single Post
  #388  
Old 16.03.2018, 22:50
patriks patriks is offline
Vacuum Cleaner
 
Join Date: Aug 2017
Location: Brasil
Posts: 15
Default

My remote jdownloader is working perfectly for more than a day oppened, thanks a lot Jiaz and mgpai for the help with the scripts and updates.

final result:

Spoiler:
1. grab all links as listed in the .txt
https://board.jdownloader.org/showpo...64&postcount=9
Code:
disablePermissionChecks(); {
    callAPI("linkgrabberv2", "addLinks", {
        "autostart": true,
        "autoConfirm": true,
        "deepDecrypt": false,
        "links": readFile("_jd3b.txt")
    })
}

2. Move all links to download list, except duplicates.
https://board.jdownloader.org/showpo...&postcount=376
Code:
// Move all links to download list
disablePermissionChecks();
moveAllToDownloadList();

// Function
function moveAllToDownloadList() {
    callAPI("linkgrabberv2", "cleanup", [], [], "DELETE_DUPE", "REMOVE_LINKS_ONLY", "ALL");
    getAllCrawledPackages().forEach(function(package) {
        callAPI("linkgrabberv2", "moveToDownloadlist", [], [package.getUUID()]);
    });
}

3. "download history" with instagram/vkontakte direct url
https://board.jdownloader.org/showpo...&postcount=232
Code:
// Save Link URLs
// Files will be created in default (Global) download folder
// Trigger Required: A Download Stopped
disablePermissionChecks();

// Function
function now() {
    var d = new Date();
    var t = d.toString().split(" ");
    return t[3] + ('0' + (d.getMonth() + 1)).slice(-2) + t[2] + " " + t[4];
}

if (link.isFinished()) {
    var data = "<details open><summary>" + link.getName() + "</summary><table>";

    var urls = {
        "Content": link.getContentURL(),
        "Container": link.getContainerURL(),
        "Origin": link.getOriginURL(),
        "Referrer": link.getReferrerURL(),
        "Date": now(),
        "instagram": link.getProperty("directurl"),
        "other": link.getProperty("url"),
        "vkontakte": link.getProperty("picturedirectlink"),
    };

    for (x in urls) {
        if (urls[x]) data += "<tr><td>" + x + "</td><td> : <a href=\"" + urls[x] + "\">" + urls[x] + "</a></td></tr>";
    }

    data += "</table></details>";


    var b /*history folder*/ = JD_HOME + "/";
    var c /*file Name */ = "_history.htm";


    writeFile(b + c, data, true);
}
Reply With Quote