View Single Post
  #18  
Old 23.10.2020, 17:34
dbrown1986 dbrown1986 is offline
Junior Loader
 
Join Date: Oct 2020
Posts: 11
Default

Quote:
Originally Posted by mgpai View Post
Quote characters must be escaped:
Code:
var destinationFolder = getPath(\"/home/seedit4me/drive/debrid/\" + link.package.name);

Better to install it in GUI and then copy the JSON value from advanced setings and paste it in the headless install via corresponding WebUI advanced settings.
Code:
Settings > Advanced Settings > EventScripter.scripts

Alternatively, after you install the script in GUI, you can copy the following file from GUI to headless:
Code:
<JDdownloader Folder>\cfg\org.jdownloader.extensions.eventscripter.EventScripterExtension.scripts.json
Okay. One last request and then I will leave this be. I PROMISE. On the headless install, I am trying to move the file from local to Google Drive via rClone; but as I mentioned in a few posts ago, it was only clearing the downloaded file and not moving it.

I was able to determine that this was because of something in the way the rClone mount is managed. The move is failing, so the script moves on to the next instruction, which is to clear the downloaded file from the download list.

As a test, I manually moved it in WinSCP and got Error 4; so I copied it instead and the copy worked without any flaws. Can you make one more adjustment to the script for me? Can you take what you've done so far, including the sub-folder by package adjustment, and modify it to copy instead of move?

I will use the COPY w/ sub-folder script on the headless,
but I will have a fallback machine as well for a MOVE w/ sub-folder script.

would replacing moveTo with copyTo do the trick?

@mgpai @Jiaz
So immensely thankful! If you have a "Buy me a coffee" or similar thing, send it to me in a private message. I'll throw you both a couple bucks for all the help you've provided.

EDIT: Somehow I broke it. JSON Pretty says the script checks out but now that I modified the var destinationFolder it won't move or copy the file at all on the windows gui or on the headless linux box.

This is how I modified the script:

Code:
[
  {
    "eventTrigger": "ON_DOWNLOAD_CONTROLLER_STOPPED",
    "enabled": true,
    "name": "Move Completed Downloads",
    "script": "if (link.finished) var destinationFolder = getPath(\"/home/seedit4me/drive/debrid/\" + link.package.name); getPath(link.downloadPath).moveTo(destinationFolder); link.remove(); }",
    "eventTriggerSettings": {
      "isSynchronous": false
    },
    "id": 1603260255137
  }
]

Last edited by dbrown1986; 23.10.2020 at 17:50.
Reply With Quote