[JDownloader] EventScripter doesn't call postprocess script

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
chocorem
Posts: 31
Joined: 21 Feb 2015, 18:31

[JDownloader] EventScripter doesn't call postprocess script

Post by chocorem »

Hello, I'm not sure if this is the right place, but I put in place jdownloader on an ubuntu server .

As long as I'm running jd under root, the script is called, but all the downloads, and also filebot renames are done under root.

when I'm running under a username, the downloads are working, jd is asking to start the script, but the script seems not to start. (I put an additional line at the script startup to monitor the script calling)

the script is owned by the user, with permissions 755 and all the files in JD directory also owned by the user
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by rednoah »

What's the error output of the filebot call?
:idea: Please read the FAQ and How to Request Help.
chocorem
Posts: 31
Joined: 21 Feb 2015, 18:31

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by chocorem »

Where can I see this ?
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by rednoah »

Wherever you're redirecting standard error. ;)

Basic Linux skills are helpful. Please read this tutorial:
viewtopic.php?f=4&t=3067
:idea: Please read the FAQ and How to Request Help.
chocorem
Posts: 31
Joined: 21 Feb 2015, 18:31

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by chocorem »

ok I was thinking there was something special to see ....

so I modified the postprocessing script by adding followng lines

Code: Select all

date +"%d-%m-%y / %T >> Filebot caalled" >> /var/log/filebot/amc-jdown.log
# Input Parameters
ARG_PATH="$1"
ARG_NAME="$2"
ARG_LABEL="$3"

# Configuration
CONFIG_OUTPUT="/raid/medias/videos"

filebot -script fn:sysenv > "/var/log/filebot/amc-jdown.log" 2>&1
filebot -script fn:amc --output "$CONFIG_OUTPUT" --action duplicate --conflict skip -non-strict --log-file /var/log/filebot/amc-jdown.log --def skipExtract=y unsorted=y music=y artwork=y excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL"
When starting Jdownloader under root, everything is working, but I get no reaction in the log file when starting the jdownloader under the standard user.

I had a look at the jodwnloader script

When I add a download

Code: Select all

ICONget {
  "rsc" : [ {
  "rsc" : [ {
  "cls" : "tld",
  "key" : "uptobox.com"
}, {
  "key" : "download"
} ],
  "cls" : "Favit"
} ],
  "cls" : "ColMerge"
}
ICONget {
  "rsc" : [ {
  "cls" : "tld",
  "key" : "uptobox.com"
}, {
  "key" : "download"
} ],
  "cls" : "Favit"
}
ICONget {
  "key" : "download"
}
Handle a direct MyJDownloader connection:414
Handle a direct MyJDownloader connection:415
Handle a direct MyJDownloader connection:416
Handle a direct MyJDownloader connection:417
Handle a direct MyJDownloader connection:418
Later when the download is finished the script window is showing

Code: Select all

THREAD: 819
819|Log.L.log 9/3/16 6:50:16 AM - FINE [ org.appwork.utils.swing.dialog.ConfirmDialog(<init>) ] -> Dialog    [allow][deny]
flag:  1000100000
title: Event Scripter permissions required!
msg:   
The Event Script 'null' requires permissions for the trigger 'Package finished'.
The script tries to 
Execute a local process. 
Do you want to allow this? If you are not sure, please check your script!
819|Log.L.log 9/3/16 6:50:16 AM - INFO [ org.appwork.utils.swing.dialog.AbstractDialog(forceDummyInit) ] -> Force Dummy Init
819|Log.L.log 9/3/16 6:50:16 AM - INFO [ org.appwork.utils.swing.dialog.AbstractDialog(resetDummyInit) ] -> Reset Dummy Info

Code: Select all

THREAD: 832
832|Log.L.log 9/3/16 6:50:22 AM - FINEST [ org.appwork.controlling.StateMachine(forceState) ] -> jd.controlling.downloadcontroller.DownloadWatchDog@41b64020 State changed RUNNING--1(546628227) -> STOPPING--1(1587695313)
832|Log.L.log 9/3/16 6:50:22 AM - FINEST [ org.appwork.controlling.StateMachine(forceState) ] -> jd.controlling.downloadcontroller.DownloadWatchDog@41b64020 State changed STOPPING--1(1587695313) -> STOPPED_STATE--1(1415194017)
Handle a direct MyJDownloader connection:687
Handle a direct MyJDownloader connection:688
then when I'm clo-icking on Allow nothing is happening. So basically the script is not starting ... basically it is not a filebot problem but a jdownloader, but perhaps you have an idea ?
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] EventScripter doesn't call postprocess script

Post by rednoah »

I guess that means your script and filebot isn't called after all (when running as normal user). Please ask the JD developers for help, and report back here if you find a solution. ;)
:idea: Please read the FAQ and How to Request Help.
hansooloo
Posts: 30
Joined: 06 Feb 2016, 14:58

Re: [JDownloader] EventScripter doesn't call postprocess script

Post by hansooloo »

My symptoms were the same, though it wasn't related to the user .. my JD is run as 'root' in a FreeBSD jail, and is started at launch via a FreeBSD startup script.

The issue was resolved after I modified the jdownloader-postprocess.sh file so that it would pass the proper PATH to the filebot.sh script ... otherwise, there was no java related PATH in the environment where the service script was executing, i.e., a sterile /bin/sh environment.

I guess there could be a feature request to @rednoah to find out where the java binary is, and if not already in the $PATH, add it to the $PATH, _before_ calling the java binary.

For me, this looked like:

Code: Select all

export PATH=$PATH:/usr/local/bin:/usr/local/openjdk8/bin
Full jdownloader-postprocess.sh file:

Code: Select all

#!/bin/sh
# Input Parameters
ARG_PATH="$1"
ARG_NAME="$2"
ARG_LABEL="$3"

. /usr/local/JDownloader/functions.sh

export PATH=${PATH}:/usr/local/bin:/usr/local/openjdk8/bin

${FILEBOT_CMD} ut_dir="$ARG_PATH"                  \
               ut_kind="multi"                     \
               ut_title="$ARG_NAME"                \
               ut_label="$ARG_LABEL"
chocorem
Posts: 31
Joined: 21 Feb 2015, 18:31

Re: [JDownloader] EventScripter doesn't call postprocess script

Post by chocorem »

So I decided to go in another direction, run jdownloader as root and changing the permissions afterward

I would like to NOT have the directory for each movie, so I put the following

Code: Select all

filebot -script fn:amc --output "$CONFIG_OUTPUT" --action move --format "{n} - {y}" --conflict override -non-strict --log-file /var/log/filebot/amc-jdown.log --def "exec=chmod 775 '{folder}/' ; chown plex:users '{folder}/'" --def artwork=n ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL"
Every thing is working fine except that the script is still creating a folder for each movie /Movies/Movie name/Movie name.mkv

how to modify it so that it isn't creating the folder ?
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [JDownloader] EventScripter doesn't call postprocess script

Post by rednoah »

Please read the Change how files will be organized and renamed section: viewtopic.php?f=4&t=215#p1561
:idea: Please read the FAQ and How to Request Help.
chocorem
Posts: 31
Joined: 21 Feb 2015, 18:31

Re: [JDownloader] EventScripter doesn't call postprocess script

Post by chocorem »

thanks a lot ..... and my fault not to have seen it !
Post Reply