#1
|
|||
|
|||
Move after extraction
Good day.
In settings I only see move to recycle or delete for option after extration. I want to auto move to specific folder for archiving after succesfull extraction. And only after sucessful extraction. How can I do this? |
#2
|
||||
|
||||
For example you can setup a custom extraction destination in Settings. That would be easiest solution.
Or you could make of eventscripter and write/use script that moves files after extraction, check https://board.jdownloader.org/showthread.php?t=70525
__________________
JD-Dev & Server-Admin |
#3
|
|||
|
|||
I am sorry I was not clear enough to understand. I want to move the archive after extraction. For extracted file it is clear I can extract to some folder. But I want to move the archive to specific destination instead of recycle bin after successful extraction.
|
#4
|
||||
|
||||
Ah, sorry. Missunderstanding. You want the archive file itself, not the extracted files, to be moved to different location?
We already got an open ticket for that but at the moment time is rare for such features but I will increase priority
__________________
JD-Dev & Server-Admin |
#5
|
|||
|
|||
Oh yes this would be very helpful. Hope to see this feature. Maybe it will not take too long. Thank you.
|
#6
|
|||
|
|||
Currently possible using a script. This script for example, moves the archive files from "JD Downloads" folder to "!TRASH!" folder after extractoin.
|
#7
|
|||
|
|||
Ah script is possible. Very interesting will try. Thanks.
Is there tutorial how to start to write script? Like what functions in Jdownloader can be modified by scripts? |
#8
|
||||
|
||||
@sherbee: Syntax is Javascript and all available methods for current selected event-type are listed in top half of the editor window
Whenever you got questions /need help or got stuck, mgpai is our script master
__________________
JD-Dev & Server-Admin |
#9
|
|||
|
|||
Thank you all.
I bit stuck already I see method readFile to read password list & I have org.jdownloader.extensions.extraction.ExtractionExtension.passwordlist.json So when I 1. read my file 2. transform to json 3. save file as: org.jdownloader.extensions.extraction.ExtractionExtension.passwordlist.json Then everything good? Or someething I miss? |
#10
|
|||
|
|||
Example script:
Code:
var interfaceName = "org.jdownloader.extensions.extraction.ExtractionConfig"; var storage = "cfg/org.jdownloader.extensions.extraction.ExtractionExtension"; var key = "PasswordList"; var value = /*Read and convert your file into JSON array format*/; callAPI("config", "set", interfaceName, storage, key, value); |
#11
|
|||
|
|||
Quote:
I am not good coder but I have something work now. I can put it here for somebody who wants it? Quote:
|
#12
|
|||
|
|||
Suggestion: Call the API to store, only if new passwords are discovered.
|
#13
|
|||
|
|||
Yes very good idea.
I make it so: Code:
/* Script reads passwords from an existing file line by line /* removes empty lines, merge with existing Jdownloader password /* list, deduplicate and store as new password list in Jdownloader */ const FILENAME = "C:\\Users\\DownloadUser\\Documents\\passwords.txt"; //Enter path to file. Escape single \ with double \\ if (getPath(FILENAME).exists()) { // Prepare API call var interfaceName = "org.jdownloader.extensions.extraction.ExtractionConfig"; var storage = "cfg/org.jdownloader.extensions.extraction.ExtractionExtension"; var key = "PasswordList"; // Read JDownloader password list for keep var pwl = callAPI("config", "get", interfaceName, storage, key); //Read password list from disk var pf = readFile(FILENAME); // Process file, remove line break characters and empty values pf = pf.split(/(\r\n|\n|\r)/gm).filter(function(e) { return e !== "\r\n" }).filter(function(e) { return e !== "" }); // Merge with list exist and remove duplicates pf = pf.concat(pwl).filter(function(e, i) { return pf.indexOf(e) >= i; }); //Call API to store only when new password list is differentiate from old password list if (!(pwl.length === pf.length && pwl.sort().every(function(value, index) { return value === pf.sort()[index] }))) { //Call Jdownloader API callAPI("config", "set", interfaceName, storage, key, pf); } } |
#14
|
||||
|
||||
@sherbee: Yes, mgpai is a true master Also thanks for sharing your final script!
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|