FileBot on RaspberryPi

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
lepaperwan
Posts: 5
Joined: 01 Apr 2014, 16:21

FileBot on RaspberryPi

Post by lepaperwan » 22 Jul 2016, 20:27

EDIT: As mentioned by ajcraig and rednoah, the portable version is actually a better solution to running FileBot on RaspberryPi.

I've seen a bunch of topics on the matter but they all seem fairly complicated, long and for what?

rednoah already provides a noarch package, only noarch is not recognized by dpkg as a valid architecture when running armhf.
However, the package is nearly valid if not for this.

So, for those of you who want to set it up quickly and painlessly, I've adapted the ipk to support a Raspbian-like architecture.
Simply run:

Code: Select all

sudo dpkg -i filebot_4.7_armhf.deb
And you're done!

I repeat, the portable version is actually a better solution but for those of you who want to understand how it could be done, here's the script that will achieve the same result and place the resulting .deb in your home.
Note that this must be run on a raspbian like architecture or a system with the necessary fakeroot and dpkg-deb utilities and will take around 5 minutes when run on the RaspberryPi.

If you need mediainfo support or pcalc support, please install libmediainfo0 or libchromaprint-tools respectively.

Code: Select all

#!/bin/sh

if [ ${#} -lt 1 ]; then
        echo 'This scripts needs you to provide the noarch ipk as its first argument'
        exit
fi

old_pwd="${PWD}"
new_pwd="/tmp/filebot-ipk2deb-$(date +%s)"

mkdir -p ${new_pwd}

ar x "${1}"
mkdir -p ${new_pwd}/DEBIAN
tar xvf control.tar.gz -C ${new_pwd}/DEBIAN
tar xvf data.tar.gz -C ${new_pwd}
rm control.tar.gz
rm debian-binary
rm data.tar.gz

cd ${new_pwd}

# Set the proper architecture for RaspberryPi
sed -i -e 's:noarch:armhf:' DEBIAN/control

# Remove existing dependencies or recommendations
# This may be improved to only extend them but I don't feel like automating that in simple shell script
sed -i -e '/^Depends.*/d' DEBIAN/control
sed -i -e '/^Recommends.*/d' DEBIAN/control
# Add Java as a dependency
# Add mediainfo and fpcalc (provided by libchromaprint-tools) as recommendations
echo 'Depends: java-runtime | java-runtime-headless' >> DEBIAN/control
echo 'Recommends: libmediainfo0, libchromaprint-tools' >> DEBIAN/control

# Replace /opt/bin with /usr/bin which lies in the standard PATH
sed -i -e 's:opt/bin:usr/bin:' DEBIAN/prerm
sed -i -e 's:opt/bin:usr/bin:' DEBIAN/postinst

# Don't set LD_LIBRARY_PATH to use default system lookup
# Move user data in user files to avoid needing sudo to run
sed -i -e '/# add APP_ROOT to LD_LIBRARY_PATH/,/fi/d' opt/share/filebot/bin/filebot.sh
sed -i -e 's:APP_DATA=.*:unset LD_LIBRARY_PATH\nAPP_DATA="${HOME}/.config/filebot"\nmkdir -p ${APP_DATA}:' opt/share/filebot/bin/filebot.sh

md5sum opt/share/filebot/FileBot.jar opt/share/filebot/bin/filebot.sh > DEBIAN/md5sums

fakeroot dpkg-deb --build . ~

cd "${old_pwd}"
rm -rf ${new_pwd}
Last edited by lepaperwan on 26 Sep 2016, 19:39, edited 2 times in total.

ajcraig
Posts: 4
Joined: 17 Jul 2016, 05:19

Re: FileBot on RaspberryPi

Post by ajcraig » 25 Jul 2016, 09:36

Why not just use the 4.7 portable?

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

Re: FileBot on RaspberryPi

Post by rednoah » 25 Jul 2016, 09:46

I'd recommend the portable package for all the embedded devices as well.
:idea: Please read the FAQ and How to Request Help.

lepaperwan
Posts: 5
Joined: 01 Apr 2014, 16:21

Re: FileBot on RaspberryPi

Post by lepaperwan » 25 Jul 2016, 20:00

Yep, quite true, I simply assumed that portable actually meant it was a .paf.exe but I took a look after ajcraig mentioned it and it seems better to use the portable version indeed.

ArieAardvarken
Posts: 2
Joined: 02 Sep 2016, 06:11

Re: FileBot on RaspberryPi

Post by ArieAardvarken » 02 Sep 2016, 06:16

I am trying this, so far it looks like it is installed and working, but I get an error. I input:

Code: Select all

filebot -rename "/mnt/usbstorage/torrents_complete/Pokemon" --db TheTVDB -non-strict -r
With and without sudo I get this output:

Code: Select all

Rename episodes using [TheTVDB]
Auto-detected query: [Pokémon, pok��mon se1]
Fetching episode data for [Pokémon]
Fetching episode data for [Pokémon Chronicles]
Fetching episode data for [Pokémon: Origins]
[MOVE] Rename [/mnt/usbstorage/torrents_complete/Pokemon/Pok��mon SE1 EP001 - Pok��mon - I Choose You!.avi] to [/mnt/usbstorage/torrents_complete/Pokemon/Pokémon - 1x01 - Pokémon! I Choose You!.avi]
[MOVE] Failed to rename [/mnt/usbstorage/torrents_complete/Pokemon/Pok��mon SE1 EP001 - Pok��mon - I Choose You!.avi]
Processed 0 files
/mnt/usbstorage/torrents_complete/Pokemon/Pok��mon SE1 EP001 - Pok��mon - I Choose You!.avi
java.nio.file.NoSuchFileException: /mnt/usbstorage/torrents_complete/Pokemon/Pok��mon SE1 EP001 - Pok��mon - I Choose You!.avi
        at net.filebot.util.FileUtilities.moveRename(FileUtilities.java:79)
        at net.filebot.StandardRenameAction$1.rename(StandardRenameAction.java:17)
        at net.filebot.cli.CmdlineOperations.renameAll(CmdlineOperations.java:625)
        at net.filebot.cli.CmdlineOperations.renameSeries(CmdlineOperations.java:255)
        at net.filebot.cli.CmdlineOperations.rename(CmdlineOperations.java:110)
        at net.filebot.cli.ArgumentProcessor.runCommand(ArgumentProcessor.java:90)
        at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:26)
        at net.filebot.Main.main(Main.java:120)
Failure (°_°)
Any idea what is wrong here? Thanks in advance! (and yes, I know, it's pokemon..)

lepaperwan
Posts: 5
Joined: 01 Apr 2014, 16:21

Re: FileBot on RaspberryPi

Post by lepaperwan » 02 Sep 2016, 09:37

I'll say again, using the portable package provided by rednoah is a better alternative to what I've posted here, I just didn't realize it until after I wrote this.

Regarding the issue you seem to be having, sudo won't solve your problem since it seems to be coming from the fact that the 'é' in Pokémon isn't handled all too well. I'm not sure where this is coming from, I've never had the issue but then again, I've never tried to organize something with non-ASCII characters (I think).

Try using the portable version first, if this doesn't solve the issue (and I'm not convinced it will), maybe just try manually renaming one of them to replace the 'é' with a normal 'e', just to confirm that this is indeed the issue.

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

Re: FileBot on RaspberryPi

Post by rednoah » 02 Sep 2016, 13:56

Looks like your system encoding is wierd. Make sure that LOCALE is set correctly.

The portable should work because it forces the LOCALE in the filebot.sh script to account for odd Linux devices that don't set LOCALE correctly.
:idea: Please read the FAQ and How to Request Help.

ArieAardvarken
Posts: 2
Joined: 02 Sep 2016, 06:11

Re: FileBot on RaspberryPi

Post by ArieAardvarken » 02 Sep 2016, 19:00

Thanks for the responses, I'm very sorry that I misread. At some point I was skimming through so many tutorials and other stuff that I overlooked the portable suggestion a bit. However, I tried that one as well and it is only working when files don't have the é in them. Only after I renamed every single item to something with just e's I got it working. Is there a way to fix this for future renames in filebot itself somehow? It would be cumbersome to rename the letters each time myself.

pricejt
Posts: 16
Joined: 01 Dec 2016, 16:50

Re: FileBot on RaspberryPi

Post by pricejt » 01 Dec 2016, 16:55

Probably a completely nob question here but where did you get the "filebot_4.7_armhf.deb" armhf.deb package from?

I have tried so many install docs for Raspbian Jessie and can't get this working.

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

Re: FileBot on RaspberryPi

Post by rednoah » 01 Dec 2016, 17:29

I recommend using the portable package: download, extract and run
:idea: Please read the FAQ and How to Request Help.

pricejt
Posts: 16
Joined: 01 Dec 2016, 16:50

Re: FileBot on RaspberryPi

Post by pricejt » 01 Dec 2016, 18:20

Ok so this is my code.

Code: Select all

sudo wget -0 filebot.tar.xz 'https://app.filebot.net/download.php?type=portable&version=4.7.5
then i run

Code: Select all

sudo tar -xvf filebot.tar.xz
That then unzips to FileBot.exe, filebot.jar, filebot.14j.ini, filebot.cmd, filebot.sh, update-filebot.sh

Is that it? i can run the exe or what is next?

Thanks again for the help

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

Re: FileBot on RaspberryPi

Post by rednoah » 01 Dec 2016, 18:24

You can run the filebot.sh script. If you do ls -l you will find that this one is executable.
:idea: Please read the FAQ and How to Request Help.

pricejt
Posts: 16
Joined: 01 Dec 2016, 16:50

Re: FileBot on RaspberryPi

Post by pricejt » 01 Dec 2016, 18:34

ok it now errors saying Failed to initialize JavaFX. Please install javafx.

I really only need this to run the amc script from qbittorrent so i don't know that i need the gui interface.

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

Re: FileBot on RaspberryPi

Post by rednoah » 01 Dec 2016, 18:50

If you call FileBit with no arguments in a headful environment then it'll launch the GUI.

Have you tried filebot -version yet?
:idea: Please read the FAQ and How to Request Help.

pricejt
Posts: 16
Joined: 01 Dec 2016, 16:50

Re: FileBot on RaspberryPi

Post by pricejt » 01 Dec 2016, 19:25

It returned this.
FileBot 4.7.5 (r4600) / OpenJDK Runtime Environment 1.8.0_111 / Linux 4.4.34-v7+ (arm)

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

Re: FileBot on RaspberryPi

Post by rednoah » 02 Dec 2016, 07:44

Looks good to me.
:idea: Please read the FAQ and How to Request Help.

pricchri
Posts: 6
Joined: 02 Dec 2016, 16:10

Re: FileBot on RaspberryPi

Post by pricchri » 02 Dec 2016, 16:34

Same Problem here! -> Rasp Pi 2 + newest Raspbian
FileBot.jar filebot -version
FileBot 4.7.5 (r4600) / Java(TM) SE Runtime Environment 1.8.0_65 / Linux 4.4.35-v7+ (arm)

Did buy FileBot for my MacBook works perfekt! Love it!

Greetings
Christopher

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

Re: FileBot on RaspberryPi

Post by rednoah » 03 Dec 2016, 01:18

Calling "filebot" without arguments to start the GUI is not a problem. That's how it's supposed to work.
:idea: Please read the FAQ and How to Request Help.

pricchri
Posts: 6
Joined: 02 Dec 2016, 16:10

Re: FileBot on RaspberryPi

Post by pricchri » 04 Dec 2016, 08:51

Calling FileBot like this: java -jar FileBot.jar

produce these msg:

Failed to initialize JavaFX. Please install JavaFX.

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

Re: FileBot on RaspberryPi

Post by rednoah » 04 Dec 2016, 15:27

Yes, calling FileBot without arguments will launch the GUI which requires JavaFX.

What seems to be the problem?
:idea: Please read the FAQ and How to Request Help.

pricchri
Posts: 6
Joined: 02 Dec 2016, 16:10

Re: FileBot on RaspberryPi

Post by pricchri » 05 Dec 2016, 10:07

So I am a little bit confused, how to run filebot-portable clean on raspbian?

Code: Select all

[email protected]:/media/hdd1-usb/downloads/FileBot 4 7 5-portable $ filebot
bash: filebot: Kommando nicht gefunden.
I just did start it like this:

Code: Select all

[email protected]:/media/hdd1-usb/downloads/FileBot 4 7 5-portable $ java -jar FileBot.jar
Thanks!

Chris

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

Re: FileBot on RaspberryPi

Post by rednoah » 05 Dec 2016, 13:29

Use the filebot.sh executable.

You'd use ./filebot.sh to run the program when you're in the same directory. If you want to call filebot as command on the command-line you need to symlink /path/to/filebot.sh to /usr/local/bin/filebot.

These are the very very basics of using Linux. You really need to know this. ;)
:idea: Please read the FAQ and How to Request Help.

pricchri
Posts: 6
Joined: 02 Dec 2016, 16:10

Re: FileBot on RaspberryPi

Post by pricchri » 09 Dec 2016, 13:09

Hi,
yes did try this before(filebot.sh and ./filebot.sh). Seems like it doesn't make nothing better starting the FileBot portable version always get the msg: Failed to initialize JavaFX. Please install JavaFX.

I did the tutorial on http://www.oracle.com/webfolder/technet ... section3s2
for installing JavaFX but doesn't fix the Problem.

[email protected]:~ $ java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) Client VM (build 25.111-b14, mixed mode)
[email protected]:~ $ javac -version
javac 1.8.0_111
[email protected]:~ $ sudo java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) Client VM (build 25.111-b14, mixed mode)

Thanks a lot!
Chris

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

Re: FileBot on RaspberryPi

Post by rednoah » 09 Dec 2016, 14:00

Do you want to run the GUI application OR do you want to run CLI commands?
:idea: Please read the FAQ and How to Request Help.

pricchri
Posts: 6
Joined: 02 Dec 2016, 16:10

Re: FileBot on RaspberryPi

Post by pricchri » 09 Dec 2016, 15:19

GUI

Post Reply