View Single Post
  #12  
Old 05.06.2019, 10:20
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 555
Default

Quote:
Originally Posted by Jiaz View Post
In meantime you could 'hack' this by setting the extraction folder as comment and with help of Eventscripter script, read the comment and then customize the extraction folder once the links are in download list
Script:
Code:
// Parse/Set Extraction Folder from Link Comment
// Trigger: A Download Started

var archive = link.getArchive();
var comment = link.getComment();

if (archive && comment) {
    var currentFolder = archive.getExtractToFolder();
    var newFolder = comment.match(/^(?:[a-zA-Z]{1}:)?(?:\\|\/).+/) || currentFolder;
    if (currentFolder != newFolder) {
        var linkId = archive.getDownloadLinks()[0].UUID;
        var archiveId = callAPI("extraction", "getArchiveInfo", [linkId], [])[0].archiveId;
        callAPI("extraction", "setArchiveSettings", archiveId, {
            "extractPath": newFolder.toString()
        })
    }
}
Reply With Quote