Page 1 of 1

Filebot Node & JDownloader

Posted: 21 Oct 2023, 13:02
by n0cturne
Hi folks,

is there any best practice for triggering Filebot Node via http call, when JDownloader has finished extracting a package.
I'm using JDownloader and Filebot Node via docker-compose.
In JDownloader I've configured the event scripter, when extracting has been finished:

Code: Select all

var amcFile = "/config/jdownloader-postprocess.sh";var path = archive.getFolder(); callAsync(function() {}, amcFile, path);
jdownloader-postprocess.sh:

Code: Select all

#!/bin/sh -xu

wget "http://192.168.242.41:5452/task?id=0"
Filebot 0.args:

Code: Select all

-script
fn:amc
/input
--output
/output
--action
move
-non-strict
--order
Airdate
--conflict
auto
--lang
de
--def
unsorted=y
artwork=n
reportError=y
excludeLink=y
clean=y
skipExtract=y
storeReport=/data/filebot/node/log/mediaReport.log
seriesFormat=Series/{n.colon(' - ')} [imdb-{imdbid}]/S{s00}/{n.colon(' - ')} [imdb-{imdbid}] - {s00e00} - {any{localize[fn.match(/German/)].t}{t}}
movieFormat=Movies/{n.colon(' - ')} [{y}, {director}, imdb-{imdbid}]{' part'+pi}
animeFormat=Series/{n.colon(' - ')} [imdb-{imdbid}]/{n.colon(' - ')} [imdb-{imdbid}] - {absolute.pad(4)} - {s00e00} - {any{localize[fn.match(/German/)].t}{t}}
movieDB=TheMovieDB
seriesDB=TheTVDB
animeDB=AniDB
--apply
refresh
--log
all
--log-file
/data/node/filebot.log
If I'm downloadig multiple files, JDownloaders calls Filebot after every single finished extraction. The Problem is, that if one packages has been extracted and another is still in extraction progress, Filebot also processes the not finished package. In this case the FIlebot moves an uncpleted media files.

Any ideas to improve?

Re: Filebot Node & JDownloader

Posted: 21 Oct 2023, 16:59
by rednoah
You'll need to somehow separate incomplete / complete files (perhaps via JD configuration, perhaps via your own event scripts) and ensure that the amc script input folder only ever contains completed files (i.e. files that are moved to the input folder with an atomic move operation) and never partially written files.


:idea: The [JDownloader] Setup for Windows, Linux and macOS instruction may not apply to your docker setup, but the event scripter examples may be helpful nevertheless. Maybe you can adjust your event script to first move the completed files to a separate amc script input folder, and then do the HTTP request to FileBot Node.


:idea: The amc script also has the --def minFileAge script parameter which allows you to ignore recently modified files, i.e. files that are currently being written / recently finished being written. If you're not in a hurry, then you can just call the amc script once a day on a schedule and just process everything that has been unchanged for a day.