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

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
GrEaTwArRiOr
Posts: 4
Joined: 07 Sep 2017, 05:15

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

Post by GrEaTwArRiOr » 14 Apr 2019, 04:26

ok thanks, if there is any luck for without folder?

User avatar
rednoah
The Source
Posts: 16129
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah » 14 Apr 2019, 05:15

What does "without folder" mean in the context of running the amc script?
:idea: Please read the FAQ and How to Request Help.

christhirteen13
Posts: 1
Joined: 29 May 2019, 23:00

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

Post by christhirteen13 » 30 May 2019, 12:00

I'm getting this in the amc.log nothing happens:

Code: Select all

Run script [fn:amc] at [Thu May 30 13:53:06 CEST 2019]
Parameter: skipExtract = y
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = y
Parameter: excludeList = excludes.txt
Parameter: ut_dir = D:\Downloads\suitsDEBDTE302
Parameter: ut_kind = multi
Parameter: ut_title = suitsDEBDTE302
Parameter: ut_label = N/A
Use excludes: C:\Users\caserv01-media\Media\excludes.txt
No files selected for processing
Done ¯\_(ツ)_/¯

User avatar
rednoah
The Source
Posts: 16129
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah » 30 May 2019, 12:38

The log indicates that D:\Downloads\suitsDEBDTE302 is empty and doesn't contain any media files.

Have you tried the usual amc script troubleshooting?
viewtopic.php?f=4&t=215
:idea: Please read the FAQ and How to Request Help.

chimera
Posts: 3
Joined: 12 Jun 2019, 06:25

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

Post by chimera » 12 Jun 2019, 06:40

Hi Rednoah,

after some hours of troubleshooting I have a question and would appreciate your help.

My setup is a OMV Host that runs a jdownloader docker instance. Filebot is installed on the OMV host.
The filebot script itself runs fine. I needed a way to call the filebot script, so I came up with a sshpass script from the docker instance which logs into the OMV instance to start the filebot script.
The only thing that is currently not working is calling the script from jdownloader, it always gives error code 2: file or directory not found.
After searching I ruled out the most obvious mistakes:

- The script, filebotrun.sh has chmod 777 and executable
- Has unix EOL encoding
- Within the jdownloader docker instance on bash, I can execute the shell script successfully but not from jdownloader itself (path is varied from jdownloader GUI, i can see the filebotrun.sh, so in theory file level access is given

Can you think of any reason why the docker jdownloader instance cannot access the shell script?
Thank you in advance for your help

Code: Select all

var script = JD_HOME + '/filebotrun.sh'

var path = package.getDownloadFolder()
var name = package.getName()
var label = package.getComment() ? package.getComment() : 'N/A'
var links = package.getDownloadLinks() ? package.getDownloadLinks() : []

function isReallyFinished() {
    for (var i = 0; i < links.length; i++) {
        if (links[i].getArchive() != null && links[i].getExtractionStatus() != "SUCCESSFUL" || !package.isFinished()) {
            return false
        }
    }
    return true
}

if (isReallyFinished()) {
    var command = [script, path, name, label, 'PACKAGE_FINISHED']
    log(command)
    log(callSync(command))
}

Shell script filebotrun.sh:

Code: Select all

#!/bin/bash
LOG="/sharedfolders/Storage/logs/amc.log"
EXC="/sharedfolders/Storage/logs/amc.txt"
SERIEN="/sharedfolders/plexroot/{plex}"
FILME="/sharedfolders/plexroot/{plex}"
USERNAME=root
HOSTS="172.17.0.1"
SCRIPT="filebot -script fn:amc --output "/sharedfolders/plexroot" --def movieformat="/sharedfolders/plexroot/{plex}" --def seriesformat="/sharedfolders/plexroot/{plex}" --action move --conflict auto -non-strict --log-file $LOG --def skipExtract=y unsorted=n music=n artwork=y --def storeReport=y --def clean=y --def plex=192.168.78.58:42Y97c6VATxkqyiNScD7 "
for HOSTNAME in ${HOSTS} ; do
    sshpass -p "pwd" ssh -o StrictHostKeyChecking=no -l ${USERNAME} ${HOSTNAME} "${SCRIPT}"
done

User avatar
rednoah
The Source
Posts: 16129
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah » 12 Jun 2019, 06:57

1.
If you're stuck with docker confinement, then i recommend using JD docker and FileBot Node docker.

Then you can create a scheduled task in the FileBot Node docker and execute it via curl from the JD docker.

That'll decoupling everything, making it easy to spot and fix issues.


2.
Is your *.sh script ever called by JD at all? If no, what does the JD log say? If yes, what does the output say?
:idea: Please read the FAQ and How to Request Help.

chimera
Posts: 3
Joined: 12 Jun 2019, 06:25

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

Post by chimera » 12 Jun 2019, 10:27

Wow, thanks for quick reply.
I'll will check the Filebot node docker, thank you.

Below is the error from the log, even when I validate the script in the jdownloader GUI it says no file or directory but I rly dont get it.

Code: Select all

net.sourceforge.htmlunit.corejs.javascript.WrappedException: Wrapped org.jdownloader.extensions.eventscripter.EnvironmentException: Line 20
java.io.IOException: Cannot run program "/config/filebotrun.sh": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:215)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:201)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:196)
	at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment.java:263)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:120)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaMethod.call(NativeJavaMethod.java:213)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1531)
	at script(:20)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
	at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxContextFactory.doTopCall(JSHtmlUnitPermissionRestricter.java:119)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3057)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115)
	at net.sourceforge.htmlunit.corejs.javascript.Context.evaluateString(Context.java:1212)
	at org.jdownloader.extensions.eventscripter.ScriptThread.evalUNtrusted(ScriptThread.java:275)
	at org.jdownloader.extensions.eventscripter.ScriptThread.executeScipt(ScriptThread.java:167)
	at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:147)
Caused by: java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 21 more
 (#20)
	at net.sourceforge.htmlunit.corejs.javascript.Context.throwAsScriptRuntimeEx(Context.java:1907)
	at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:146)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaMethod.call(NativeJavaMethod.java:213)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1531)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
	at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxContextFactory.doTopCall(JSHtmlUnitPermissionRestricter.java:119)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3057)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115)
	at net.sourceforge.htmlunit.corejs.javascript.Context.evaluateString(Context.java:1212)
	at org.jdownloader.extensions.eventscripter.ScriptThread.evalUNtrusted(ScriptThread.java:275)
	at org.jdownloader.extensions.eventscripter.ScriptThread.executeScipt(ScriptThread.java:167)
	at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:147)
Caused by: org.jdownloader.extensions.eventscripter.EnvironmentException: Line 20
java.io.IOException: Cannot run program "/config/filebotrun.sh": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:215)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:201)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:196)
	at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment.java:263)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:120)
	at net.sourceforge.htmlunit.corejs.javascript.NativeJavaMethod.call(NativeJavaMethod.java:213)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1531)
	at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105)
	at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411)
	at org.jdownloader.scripting.JSHtmlUnitPermissionRestricter$SandboxContextFactory.doTopCall(JSHtmlUnitPermissionRestricter.java:119)
	at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3057)
	at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115)
	at net.sourceforge.htmlunit.corejs.javascript.Context.evaluateString(Context.java:1212)
	at org.jdownloader.extensions.eventscripter.ScriptThread.evalUNtrusted(ScriptThread.java:275)
	at org.jdownloader.extensions.eventscripter.ScriptThread.executeScipt(ScriptThread.java:167)
	at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:147)
Caused by: java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 21 more

	at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment.java:266)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:120)
	... 12 more
Caused by: java.io.IOException: Cannot run program "/config/filebotrun.sh": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:215)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:201)
	at org.appwork.utils.processes.ProcessBuilderFactory.runCommand(ProcessBuilderFactory.java:196)
	at org.jdownloader.extensions.eventscripter.sandboxobjects.ScriptEnvironment.callSync(ScriptEnvironment.java:263)
	... 17 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 21 more

chimera
Posts: 3
Joined: 12 Jun 2019, 06:25

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

Post by chimera » 12 Jun 2019, 12:43

Hey Rednoah,

after looking at Filebot node, I would just use the filebot watcher to monitor my jdownloader extraction destination folders and go via amc from there.
That is way easier than I thought in comparison to my sshpass approach between containers lool ;-)

Impressive work btw, thank you for the tools mate!

OutrageousGem
Posts: 11
Joined: 12 Apr 2019, 06:20

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

Post by OutrageousGem » 13 Jun 2019, 12:56

rednoah wrote:
12 Jun 2019, 06:57
1.
If you're stuck with docker confinement, then i recommend using JD docker and FileBot Node docker.

Then you can create a scheduled task in the FileBot Node docker and execute it via curl from the JD docker.

That'll decoupling everything, making it easy to spot and fix issues.
I ended up with the same idea in my own download setup. But when I try to schedule a task in FileBot Node docker I just get a

Code: Select all

{"success":false,"error":"NOT IMPLEMENTED"}
I doubt you would recommend unimplemented features. Any idea what might be going wrong?

User avatar
rednoah
The Source
Posts: 16129
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah » 13 Jun 2019, 16:17

Ups. Looks like this feature is only enabled for SYNO and QNAP builds even though it probably would work for docker too. I guess it's not as easy as I thought with the current release. I'll see what I can do for the next release.
:idea: Please read the FAQ and How to Request Help.

OutrageousGem
Posts: 11
Joined: 12 Apr 2019, 06:20

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

Post by OutrageousGem » 14 Jun 2019, 07:01

Ah. I will hope for the next release then. Thank you.

User avatar
rednoah
The Source
Posts: 16129
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah » 15 Jun 2019, 07:16

I've update the FileBot Node docker container to FileBot Node 0.2.8.4. Please try the latest container and let me know if you encounter any problems.
:idea: Please read the FAQ and How to Request Help.

OutrageousGem
Posts: 11
Joined: 12 Apr 2019, 06:20

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

Post by OutrageousGem » 17 Jun 2019, 07:43

Works great. Thank you! Two questions though:

1, Is it possible to somehow un-schedule a task? Can not find that option.

2, Is there any way to also schedule it to run at a specified time? Currently only a API call seems possible.

User avatar
rednoah
The Source
Posts: 16129
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah » 17 Jun 2019, 08:20

1.
Yes, but only by directly modifying the FileBot Node application data files, which are stored in /data/.filebot-node (container-point-of-view).


2.
FileBot Node does not include a scheduler. The scheduling of commands is best done with the built-in facilities of the platform, i.e. cron if you're using a generic Linux system.

:!: But at that point, why would you be using FileBot Node in the first place? You could just use cron to schedule docker filebot amc script calls directly, without having FileBot Node running at all.
:idea: Please read the FAQ and How to Request Help.

OutrageousGem
Posts: 11
Joined: 12 Apr 2019, 06:20

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

Post by OutrageousGem » 17 Jun 2019, 09:37

1, Got it.

2, Just because Node makes it much more convenient to rapidly test different iterations of a command and schedule it when it finally does the right thing. (I am just bad at writing shell scripts. Always some typo / unescaped character / etc.... :? ). The API Is all I currently really need.

User avatar
rednoah
The Source
Posts: 16129
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah » 17 Jun 2019, 12:52

OutrageousGem wrote:
17 Jun 2019, 09:37
Just because Node makes it much more convenient to rapidly test different iterations of a command and schedule it when it finally does the right thing. (I am just bad at writing shell scripts. Always some typo / unescaped character / etc.... :? ). The API Is all I currently really need.
I see. Yes, FileBot Node certainly has value in generating CLI commands. You could always use the WebUI to generate commands and the copy & paste that into your scheduled shell script.

:idea: Use the @file syntax for reading command-line arguments from external text files. That'll make things easy as pie. That's also what prepared tasks do in form of *.args files. ;)
:idea: Please read the FAQ and How to Request Help.

Post Reply