Last active
June 26, 2018 09:32
-
-
Save HanSooloo/b47be6cd6e4384d0a8ccc592ef421d73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var script = JD_HOME + '/jdownloader-postprocess.sh' | |
var path = package.getDownloadFolder() | |
var name = package.getName() | |
var first_file = package.getDownloadLinks() ? package.getDownloadLinks()[0].getArchive() : "N/A" | |
var links = package.getDownloadLinks() ? package.getDownloadLinks() : [] | |
var FilePath = getPath(path) | |
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 = [script, path, name, first_file, 'PACKAGE_FINISHED'] | |
log(command) | |
log(callSync(command)) | |
log(package.getDownloadFolder()) | |
log(FilePath) | |
// log(FilePath.delete()) | |
// log(package.remove()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment