Skip to content

Download Clients

Atrox edited this page Jan 2, 2017 · 2 revisions

JDownloader

You need to activate the Event Scripter extension and add the following two scripts:

Cain after package finished (without extraction)

Trigger: Package finished

var path = package.getDownloadFolder()
var links = package.getDownloadLinks() ? package.getDownloadLinks() : []

function isReallyFinished() {
    for (var i = 0; i < links.length; i++) {
        if (links[i].getArchive() != null && links[i].getExtractionStatus() != "SUCCESSFUL" || !package.isFinished()) {
            return false
        }
    }
    return true
}

if (isReallyFinished()) {
    var command = ["cain", "run", "--path", path]
    log(command)
    log(callSync(command))
}

Cain after extraction

Trigger: Archive extraction finished

var links = archive.getDownloadLinks() ? archive.getDownloadLinks() : []
var package = links.length > 0 ? links[0].getPackage() : null

function isReallyFinished() {
    for (var i = 0; i < links.length; i++) {
        if (links[i].getArchive() != null && links[i].getExtractionStatus() != "SUCCESSFUL" || !package.isFinished()) {
            return false
        }
    }
    return true
}

if (package && isReallyFinished()) {
    var command = ["cain", "run", "--path", package.getDownloadFolder()]
    log(command)
    log(callSync(command))
}

Should look like this afterwards:

Img

Your favorite client seems to be missing?

If your client is missing, please open a issue.

Clone this wiki locally