JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #21  
Old 23.10.2020, 18:04
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,000
Default

Quote:
Originally Posted by dbrown1986 View Post
... Somehow I broke it.
Missing "{" bracket:

if (link.finished) {var destinationFolder ...

Best way to avoid such errors are to add/test it in GUI (Click "Test compile" to check for syntax errors) and then add it to headless.
Reply With Quote
  #22  
Old 24.10.2020, 02:52
dbrown1986 dbrown1986 is offline
Junior Loader
 
Join Date: Oct 2020
Posts: 11
Default

Quote:
Originally Posted by mgpai View Post
Yes. It is also possible to use eventscripter method to delete the source file if/after it is successfully copied.

Code:
// Move downloaded files to user-specified folder and remove the link from download list
// Trigger: A Download Stopped

if (link.finished) {
    var destinationFolder = getPath("/home/seedit4me/drive/debrid/" + link.package.name);
    var copied = getPath(link.downloadPath).copyTo(destinationFolder);

    if (copied) {
        getPath(link.downloadPath).delete()
        link.remove();
    }
}
I've tried. I copied this without changing a damn thing. Inputted it into the GUI, then opened the script.json file and parsed that through JSON Pretty to make sure that everything was okay and the script still won't work. Not on linux and now not in the windows GUI. I'm assuming there's just too many environment variables from the OS itself that are changing. It's too frustrating. I have spent the better part of two weeks trying to get this to function, and just when I feel like I'm making progress; everything rolls back. I give up. Thanks anyways guys.
Reply With Quote
  #23  
Old 24.10.2020, 07:38
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,000
Default

Quote:
Originally Posted by dbrown1986 View Post
... the script still won't work.
You can find me in JD Chat for online assistance with it:
Code:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader
Reply With Quote
  #24  
Old 26.10.2020, 19:55
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 68,318
Default

@mgpai: thanks for the hint. good sight

@dbrown1986: The script doesn't care about "environment variables" and yes, the previous post shows the missing bracket. I've just tested the exact same script (different path) and working fine.
see pastebin.com/RmHZPg3F
__________________
JD-Dev & Server-Admin
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:57.
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 - 2020, Jelsoft Enterprises Ltd.