|
#1
|
|||
|
|||
Delete comment & password after extraction
Hello, I ever asked this on chat with mgpai but I think I asked it wrong and our chat ending without resolve this.
So what I asked is JDownloader2 delete comment and password after file extracted (with auto extraction) (for that package only or other package who successfully extracted) So far mgpai script (with my costume script) has failed Code:
getAllDownloadLinks().forEach(function(link) { if (link.getExtractionStatus == true) { if (link.getProperty("pass")) link.setProperty("pass", ""); if (link.getComment()) link.setComment(""); } }) In "package finished" triger, system can automaticly get package name. But in "archieve extraction finished" triger, system cannot get package name. I think I can transfer package name, but I don't know how use it. Last edited by raztoki; 07.01.2020 at 01:21. Reason: [code] bbcode inserted |
#2
|
||||
|
||||
But it works without trigger? Says mgpai with the Original script.
Quote:
Code:
var packageName = archive.getDownloadLinks()[0].getPackage().getName();
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep. |
#3
|
||||
|
||||
bit of information if your unaware
'pass' DownloadLink property purpose is for pre-download password requirement. the extract module does utilise for extraction also, more so as a failover. extraction has its own stored field and is called archive.getSettings().getPasswords(); within ExtractionController.run(). raztoki
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#4
|
||||
|
||||
I have tested your script and link.getExtractionStatus() has not "true" or "false", only a string like "SUCCESSFUL" in my tests with your trigger "Archive extraction finished".
Quote:
Quote:
Example: Code:
// Remove passwords and comments // Trigger "Archive extraction finished" archive.getDownloadLinks().forEach(function(link) { if (link.getExtractionStatus() == "SUCCESSFUL") { if (link.getProperty("pass")) link.setProperty("pass", ""); if (link.getComment()) link.setComment(""); var linkId = link.UUID; var archiveId = callAPI("extraction", "getArchiveInfo", [linkId], [])[0].archiveId; callAPI("extraction", "setArchiveSettings", "" + archiveId, { "archiveId": "" + archiveId, "passwords": [""], "finalPassword": "REMOVED" }); } }); Quote:
Example myArchive.setPasswords([""]); like my script "GPU Password detection" or the way with getInfo like Get Archive Password (Downloads) (Downloads/Contextmenu). Code:
/* =============== Classes =============== */ /* === Archive === */ /* ========= Methods =========*/ var myBoolean = myArchive.equals(myObject); var myString = myArchive.getArchiveType(); var myDownloadLink[] = myArchive.getDownloadLinks(); var myString = myArchive.getExtractToFolder(); var myFilePath[] = myArchive.getExtractedFilePaths(); var myString[] = myArchive.getExtractedFiles(); var myString = myArchive.getExtractionLog(); var myString = myArchive.getFolder(); var myObject = myArchive.getInfo(); var myString = myArchive.getName(); var myList = myArchive.getPasswords(); var myString = myArchive.getUsedPassword(); var myInt = myArchive.hashCode(); var myBoolean = myArchive.isPasswordProtected(); myArchive.setPasswords(myList);
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep. Last edited by thecoder2012; 11.01.2020 at 21:55. |
Thread Tools | |
Display Modes | |
|
|