JDownloader Community - Appwork GmbH
 

Go Back   JDownloader Community - Appwork GmbH > English Support > Suggestions & Requests
Reply
 
Thread Tools Display Modes
  #1  
Old 15.11.2019, 20:28
Bunga
Guest
 
Posts: n/a
Question 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("");
    }
})
I kinda confuse because lack of logic & variable.
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
Reply With Quote
  #2  
Old 06.01.2020, 22:36
thecoder2012's Avatar
thecoder2012 thecoder2012 is offline
Official 9kw.eu Support
 
Join Date: Feb 2013
Location: Internet
Posts: 1,324
Default

Quote:
Originally Posted by Bunga View Post
So far mgpai script (with my costume script) has failed
But it works without trigger? Says mgpai with the Original script.

Quote:
Originally Posted by Bunga View Post
I kinda confuse because lack of logic & variable.
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.
See this thread
Code:
var packageName = archive.getDownloadLinks()[0].getPackage().getName();
With try and catch it's thinkable or with the save system (setProperty/getProperty with global flag) and two triggers (e.g. extraction finished, interval)
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep.
Reply With Quote
  #3  
Old 07.01.2020, 01:44
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,614
Default

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. :]
Reply With Quote
  #4  
Old 11.01.2020, 21:47
thecoder2012's Avatar
thecoder2012 thecoder2012 is offline
Official 9kw.eu Support
 
Join Date: Feb 2013
Location: Internet
Posts: 1,324
Default

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:
Originally Posted by raztoki View Post
bit of information if your unaware
'pass' DownloadLink property purpose is for pre-download password requirement.
Yes.

Quote:
Originally Posted by raztoki View Post
the extract module does utilise for extraction also, more so as a failover.
FinalPassword is not removable (empty string or null) and can only be overwritten with the callapi in my tests.

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:
Originally Posted by raztoki View Post
extraction has its own stored field and is called archive.getSettings().getPasswords(); within ExtractionController.run().
In the JD source code, yes. Without "getSettings" in the Event Scripter says the help page.
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 14:19.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.