[HowTo] Install filebot with media info

Here is my guide to install the latest filebot on OSMC.
Tested with a Raspberry 2 and OSMC 2017.02-2 and Filebot 4.7.7

Withi this tutorial will install also media info binding, it is not required but it can be usefull if you want to add extra information to your file names.

The tutorial is based on this tutorial: [GUIDE] Filebot + MediaInfo + Raspberry Pi - FileBot

First we will install all dependencies:

sudo update
sudo apt-get install binutils xz-utils libjna-java  mediainfo

Then add debian backports to your sources list to instal openjdk 8

sudo nano /etc/apt/sources.list

Add this line to the end of the file (this is for debian jessie, if you have another version check Instructions)

deb http://ftp.debian.org/debian jessie-backports main

Then install openjdk 8 headless

sudo update
sudo apt-get -t jessie-backports install openjdk-8-jdk-headless

Ok now we will start with the proper filebot installation

mkdir /tmp/filebot && cd /tmp/filebot

Download filebot lastest version from: FileBot - Browse /filebot at SourceForge.net
It must be the noarch ipk, you can use wget with the sourceforge link or download and upload using ftp to /tmp/filebot

ar -x filebot_4.7.7_noarch.ipk
xz -d data.tar.xz
tar xvf data.tar
sudo cp -rf opt/ /

Now you have installed filebot on /opt/share/filebot lets go for media info.
For media info we need jna 4.0.0 but the jna version provided with openjdk is 3.2.7 so we will update it first.

mkdir /tmp/jna-4.0.0
cd /tmp/jna-4.0.0
wget --no-check-certificate https://maven.java.net/content/repositories/releases/net/java/dev/jna/jna/4.0.0/jna-4.0.0.jar
wget --no-check-certificate https://maven.java.net/content/repositories/releases/net/java/dev/jna/jna-platform/4.0.0/jna-platform-4.0.0.jar
jar xf jna-4.0.0.jar
sudo cp -p com/sun/jna/linux-arm/libjnidispatch.so /usr/lib/arm-linux-gnueabihf/jni/libjnidispatch_4.0.0.so
cd /usr/lib/arm-linux-gnueabihf/jni/
sudo mv libjnidispatch.so libjnidispatch_3.2.7.so
sudo ln -s libjnidispatch_4.0.0.so libjnidispatch.so

cd /usr/share/java
sudo rm jna.jar
sudo cp /tmp/jna-4.0.0/*.jar .
sudo ln -s jna-4.0.0.jar jna.jar
sudo ln -s jna-platform-4.0.0.jar jna-platform.jar
java -jar jna.jar

Ok now we go with the proper mediainfo binding

cd /opt/share/filebot
sudo ln -s /usr/lib/arm-linux-gnueabihf/libmediainfo.so.0 libmediainfo.so
sudo ln -s /usr/lib/arm-linux-gnueabihf/libzen.so.0 libzen.so

And finally we check that everything is installed properly

sudo ./filebot.sh -script "fn:sysinfo"

The result should be something along the lines:

FileBot 4.7.7 (r4678)
JNA Native: 4.0.0
MediaInfo: 0.7.70
Apache Commons VFS: [zip, rar]
Chromaprint: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-02-10 (r480)
Groovy: 2.4.7
JRE: OpenJDK Runtime Environment 1.8.0_121
JVM: 32-bit OpenJDK Zero VM
CPU/MEM: 4 Core / 177 MB Max Memory / 12 MB Used Memory
OS: Linux (arm)
Package: IPKG
Data: /opt/share/filebot/data/root
uname: Linux osmc 4.4.27-7-osmc #1 SMP PREEMPT Tue Jan 24 03:38:31 UTC 2017 armv7l GNU/Linux
Done ã¾(ï¼ âã¼âï¼ )ã

If you will be using non english locales in your downloaded files you need to properly configure the locales on the system. Otherwise filebot will not be able to recognise properly the name of your files and will skip them when renaming.

sudo apt-get install locales
sudo dpkg-reconfigure locales

In the first step of dpkg-reconfigure, you can select all locales (it will take a while to process) or just the ones that you could use.
In the second step, select the default locale according to your usage (es_ES.UTF-8 for spanish pt_BR.UTF-8 for brazilian portuguese etc.)
Then let it recompile the locales you selected in the first step and close your connection and reconnect.
You can now check the locale in use with locale.

Also remember to check from time to time for filebot updates.

The script I am using for renaming all my transmission files is like this:

#!/bin/sh

DATE_STAMP=` date +%d-%m-%Y-%T`
echo ${DATE_STAMP}

FILEBOT="/opt/share/filebot/filebot.sh"
COMPLETED="/media/Seagate Expansion Drive/Completed/"
DESTINATION="/media/Seagate Expansion Drive/"
LANG="--lang es"
ACTION="--action copy"
CONFLICT="--conflict skip"
SCRIPT="-script fn:amc"
DEF="--def reportError=y music=y excludeList=amc.excludes gmail=<yourUser>:<yourpassword> kodi=127.0.0.1:8080"
LOG="amc.log"

"$FILEBOT" $SCRIPT $LANG $ACTION $CONFLICT -non-strict --output "$DESTINATION" ${DEF} "$COMPLETED"  --log ALL

DATE_STAMP=` date +%d-%m-%Y-%T`
echo ${DATE_STAMP}

This will copy all files on COMPLETED to folder under DESTINATION (TV Shows, Movies…) with a proper name for using with kodi, then it will send you an email with the action and notify kodi to reindex.
The files already processed will be stored on amc.excluded on DESTINATION to avoid processing the same files twice.

Change the language to your own and modify ACTION to move if you prefer (I do copy it to keep it seeding for some time), and use your gmail account with an App Password (Sign in with App Passwords - Google Account Help).

Check AMC script options if you need to change something else: Automated Media Center - FileBot

I hope you find this usefull as it took me some time to get all this working.
Tell me if you have any problem with the instructions and donate to filebot development to keep it getting updates.

Thanks for this.

There is no .ipk available for Filebot 4.7.8 on SourceForge, but there is filebot_4.7.8-armhf.deb.

This will install filebot in /usr/share not /opt/share, and bundles appropriate shared libraries, as well as fpcalc (Chromaprint). It also links /usr/bin/filebot to /usr/share/filebot/filebot.sh

It also keeps it’s user data in .filebot in your home directory rather than /opt/share/filebot/data/

Make sure LANG is set to something UTF-8, either in your ssh client, /etc/profile or ~/.profile

osmc@osmc:~$ sudo filebot -script "fn:sysinfo"
FileBot 4.7.8 (r4846)
JNA Native: 5.1.0
MediaInfo: 0.7.73
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-03-24 (r490)
Groovy: 2.4.8
JRE: OpenJDK Runtime Environment 1.8.0_121
JVM: 32-bit OpenJDK Zero VM
CPU/MEM: 4 Core / 177 MB Max Memory / 12 MB Used Memory
OS: Linux (arm)
Package: DEB
Data: /root/.filebot
uname: Linux osmc 4.4.27-9-osmc #1 SMP PREEMPT Tue Mar 14 20:54:19 UTC 2017 armv7l GNU/Linux
Done ヾ(@⌒ー⌒@)ノ
osmc@osmc:~$
1 Like

Hi,

It seems very useful, but for some reason I am unable to get it executed after transmission has finished to download.

I have been able to use the other script: https://github.com/filebot/plugins/blob/master/bash/transmission-postprocess.sh

on my Debian desktop with transmission, but for some reason yours and the other do not get executed on the Vero 4k.

Java, transmission, filebot and mediainfo are installed and working, the script is chmod 777, stopped transmission-daemon and edited settings.json to include the option to run script (true) and the path to the script itself.

Nevertheless no luck so far.

Any thoughts?

An update: the Deluge filebot plugin works.

https://github.com/Laharah/deluge-FileBotTool

Hi,
when i start to install media info, i can’t rename the libjnidispatch.so this file no exist, here is the error message/

root@osmc:/usr/lib/arm-linux-gnueabihf/jni#
root@osmc:/usr/lib/arm-linux-gnueabihf/jni# mv libjnidispatch.so libjnidispatch_3.2.7.so
mv: cannot stat ‘libjnidispatch.so’: No such file or directory
root@osmc:/usr/lib/arm-linux-gnueabihf/jni# ls -l
total 160
-rw-r–r-- 1 root root 55188 Apr 12 2017 libjnidispatch.system.so
-rw-r–r-- 1 root root 105543 Jun 4 2013 libjnidispatch_4.0.0.so

help pls