View Single Post
  #2502  
Old 04.12.2022, 22:13
Ciesto Ciesto is offline
Modem User
 
Join Date: Nov 2015
Posts: 3
Default

Quote:
Originally Posted by mgpai View Post
Also, the script currently checks the status of individual downloads. It can be modified to check just the status of packages instead.
Hi...
I just discovered this script, which is about 95% what I was looking for. How do I have to modify the script that the extraction of the PACKAGE will start as soon as ALL links inside of this package are downloaded? Right now the script waits until all packages are completly downloaded.

In my case I do have often several packages with 2 or more archives.
Example:
Package 1:
archive_A_part1.rar
archive_A_part2.rar
archive_B_part1.rar
archive_B_part2.rar

Package 2:
archive_AA_part1.rar
archive_AA_part2.rar
archive_AA_part3.rar
archive_AA_part4.rar

As soon as all parts of archive_A and archive_B (the complete Package 1) are downloaded the extraction should start.

Edit: Sorry... forgot to mention that my question is related to this script:

https://board.jdownloader.org/showpo...&postcount=349

Alright... just figured it out by myself. Simpler than I thought.
Now my script looks like this:

Code:
// Extract all archives after thecomplete package is finished
// Trigger Required: Package Finished
// In "Archive Extractor" settings, disable the "Extract archives after download (default value)" checkbox
// Related Post: https://board.jdownloader.org/showpost.php?p=418712&postcount=345

if (package.isFinished()) startExtraction();


function startExtraction() {
    getAllDownloadLinks().forEach(function(link) {
        if (!link.getArchive()) return;
        if (!link.isFinished()) return;
        if (link.getExtractionStatus() != null) return;
        if (link.getArchive().getInfo().autoExtract == false) return;
        callAPI("extraction", "startExtractionNow", [link.getUUID()], []);
    });
}

Last edited by Ciesto; 04.12.2022 at 22:37. Reason: forget to mention for which cript my question is.
Reply With Quote