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

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
User avatar
rednoah
The Source
Posts: 14647
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post by rednoah » 04 Mar 2016, 23:57

Welcome to the official JDownloader help & support topic!


Automated Media Center

This guide will help you with setting up the FileBot AMC Script script with JDownloader. We'll add our own Event Scripter event script, which passes some arguments along to our shell script, which then calls filebot as usual.
  1. Install the Event Scripter plugin
  2. Add the Execute FileBot (PackageFinished) script
  3. Add the Execute FileBot (ArchiveExtracted) script
  4. Download the jdownloader-postprocess.sh (Mac and Linux) or jdownloader-postprocess.cmd (Windows) script, make sure it's executable, and place it in the JD_HOME folder.

    The script location is set in the first line:

    Code: Select all

    var script = '/path/to/jdownloader-postprocess'

You may edit the configuration files directly if you are running JDownloader on a headless server:
org.jdownloader.extensions.eventscripter.EventScripterExtension.scripts.json


Known Issues:
  • The PackageFinished script is called before extraction is complete. The ArchiveExtracted script is called for each individual archive. In order to avoid FileBot processing partially extracted files it is recommended that extraction is disabled in JDownloader and enabled in FileBot via the --def skipExtract=n option. If you need JDownloader for password cracking you could try this instead.
If something is not working, please read Shell Script Debugging for Beginners and make sure it's not a simple PATH or permission issue.
:idea: Please read the FAQ and How to Request Help.

Effe
Posts: 1
Joined: 15 Sep 2017, 10:05

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

Post by Effe » 15 Sep 2017, 10:22

I need help with this script.

I followed the guide, I get no error, but the files are not renamed.

otr
Posts: 7
Joined: 06 Aug 2018, 20:37

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

Post by otr » 07 Aug 2018, 10:01

I would like to ask for help with this. I'll put this in a way so that it may help others in the future as well.
My setup: DS218play, jDownloader headless + my.jdownloaderorg as GUI + filebot.

This is a screen capture of the GUI that I have. I fail to enter the scripts (e.g. https://github.com/filebot/plugins/blob ... inished.js) via c&p (plus modifying path) into that window. I get an error (failed to set new value).

Image

My question: Is that even the right way? Or do I need to follow the headless path that you describe above?
In that case,
- where do I put that script?
- can you provide the second script as JSON as well please? The provided one only works for "ON_PACKAGE_FINISHED", but not for ArchiveExtracted.

Thanks!

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

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

Post by rednoah » 07 Aug 2018, 10:21

I've never used the JD WebUI. It looks very basic. I guess it's just a simple interface so you can write the org.jdownloader.extensions.eventscripter.EventScripterExtension.scripts.json configuration file.

You can try to just copy the raw JSON:
https://github.com/filebot/plugins/blob ... ripts.json

The easiest way is probably to log in via SSH, find the configuration files, and then write them directly, and restart JD:

Code: Select all

find /volume1 -iname '*EventScripterExtension*'
:idea: You can use the JD desktop app and setup Event Scripter that way, and the just copy the configuration file.
:idea: Please read the FAQ and How to Request Help.

hansooloo
Posts: 28
Joined: 06 Feb 2016, 14:58

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

Post by hansooloo » 09 Aug 2018, 21:00

Take a look at this shell script I created for my setup where I was running into the exact same issue: https://gist.github.com/HanSooloo/89528 ... 2668b0330e

You _will_ need the `jq` package, which is readily available on both macOS (via brew) or any Linux distribution.

otr
Posts: 7
Joined: 06 Aug 2018, 20:37

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

Post by otr » 17 Aug 2018, 12:10

Hi,

sorry for being silent for a bit, I have been on a short trip. In the meantime, my setup is now working and I wanted to report back my specifics, so that others may benefit, but also so that I can learn in case I have missed something important.

This is what is working for me:

1. jDownloader Event Scripter calls this script

Code: Select all

[{"eventTrigger":"ON_PACKAGE_FINISHED", "enabled":true, "name":"FileBot", "script":"var amcFile = '/volume1/Downloads/jdtofilebotv2.sh';var path = '/volume1/Downloads/'; callAsync(function() {}, amcFile, path);", "eventTriggerSettings":{}, "id":123654}]
For people that were new to this, just like me:
- The above is the exact "text" that you can see in the jDownloader UI. Compare this screenshot: https://snag.gy/kYHCEN.jpg
- id:123654 is a random number I thought of. The way I understand it this is the ID the process runs under and I would be able to find it under this ID, if I had to look for it.

2. the jdtofilebotv2.sh script that is called above

Code: Select all

#!/bin/sh
export JAVA_OPTS="-Xmx256m"
/var/packages/filebot/target/filebot.sh -script 'fn:amc' /volume1/Downloads --output /volume1/Media/ --conflict auto --lang en --def 'clean=y' 'skipExtract=y'  'excludeList=.excludes'
I would be happy to get comments on this, especially since people later might look at this and assume that I did smart things (I did not - I just figured out what works for me somehow).
One issue I have is that I still do not find the filebot log file created by this setup.

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

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

Post by rednoah » 17 Aug 2018, 20:03

1.
filebot should work just fine instead of /var/packages/filebot/target/filebot.sh but should you need an absolute path for some reason, then /usr/local/bin/filebot is recommended.


2.
-non-strict is generally used in all my examples, since strict mode tends to be too strict for what people use the amc script for usually.


3.
--log-file /path/to/log is recommended so you know exactly where the FileBot log is. This option will make sure that logs are written to both console and file.
:idea: Please read the FAQ and How to Request Help.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests