Filebot on Synology Diskstation

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
bjarkenera
Posts: 3
Joined: 28 Aug 2012, 13:40

Filebot on Synology Diskstation

Post by bjarkenera »

Hi,

I am new to Filebot and I have it installed on both pc and Synology Diskstation (NAS) through the package centre.
I am using PuTTY on my pc to send commands to the Filebot on the Diskstation, but I don't know the exact path to my video-folder on the diskstation, because I keep getting error messages:

Code: Select all

filebot -rename /volume1/video/Tv Shows

Filename pattern: [NaN] SxE, [NaN] CWS
Rename episodes using [TheTVDB]
Exception: No media files: [/volume1/video/Tv, /volume1/homes/admin/Shows]
Failure (?_?)
At least I think it is because of a wrong path, it might be something else (like a spacing?) - that is what I am hoping someone has some if any experience with this??
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot on Synology Diskstation

Post by rednoah »

First of all you need to quote the argument which is obvious from the error message as it is interpreted as two:
=> "/volume1/video/Tv Shows"

Now you could add -r (for recursive) and -non-strict (for allowing fuzzy matching required for handling many shows at once) but I'd recommend running a rename batch per folder, not all at once.

e.g. Script for running -rename on each folder:

Code: Select all

filebot -script fn:renall <options> <folder>
:idea: Please read the FAQ and How to Request Help.
bjarkenera
Posts: 3
Joined: 28 Aug 2012, 13:40

Re: Filebot on Synology Diskstation

Post by bjarkenera »

Thank you for you quick answer :)
Ah yes, I see. Trouble is that I have tried both with and without quotation marks - no difference. Same thing with renaming a specific folder:

Code: Select all

filebot -rename "/volume1/video/Tv Shows"
Filename pattern: [NaN] SxE, [NaN] CWS
Rename episodes using [TheTVDB]
Exception: No media files: [/volume1/video/Tv, /volume1/homes/admin/Shows]
Failure (?_?)

Code: Select all

filebot -rename "/volume1/video/Tv Shows/Californication/Season 5"
Filename pattern: [NaN] SxE, [NaN] CWS
Rename episodes using [TheTVDB]
Exception: No media files: [/volume1/video/Tv, /volume1/homes/admin/Shows/Californication/Season, /volume1/homes/admin/5]
Failure (?_?)
Trying to use -non-strict gave same sort of error - maybe it is the spaces?:

Code: Select all

filebot -rename "/volume1/video/Tv Shows/Californication/Season 5" -non-
strict
Filename pattern: [NaN] SxE, [NaN] CWS
Rename episodes using [TheTVDB]
Exception: No media files: [/volume1/video/Tv, /volume1/homes/admin/Shows/Californication/Season, /volume1/homes/admin/5]
Failure (?_?)
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot on Synology Diskstation

Post by rednoah »

Maybe use ' ? or escape blank with \? In anycase this is a console problem, just read some tutorials online and see if you can make it work.
:idea: Please read the FAQ and How to Request Help.
bjarkenera
Posts: 3
Joined: 28 Aug 2012, 13:40

Re: Filebot on Synology Diskstation

Post by bjarkenera »

Thanks, using '? worked
Trin
Posts: 1
Joined: 28 Nov 2012, 14:25

Re: Filebot on Synology Diskstation

Post by Trin »

So I finally figured out this problem after much frustration. The issue is that busybox does not pass the arguments to the filebot shell script in a manner in which they can be parsed correctly. You have to write out the full thing in order for it to work correctly.

ie:

Code: Select all

filebot -script fn:watcher -rename /volume1/video/tmp/ --output /volume1/video/ --format "TV_SHOWS/{n}/Season {s}/{n}.{s00e00}.{t}" --db TheTVDB
will break because there is a space between Season and {s} and it will parse them as separate arguments and no amount of backslashes, single or double quotes, etc will get it to work. (Why replacing a space with a ? when you run filebot -rename somehow works, I have no idea. That definitely doesn't work for the format argument unfortunately.)

This will work:

Code: Select all

java -jar /usr/local/filebot/filebot.jar -script fn:watcher -rename /volume1/video/tmp/ --output /volume1/video/ --format "TV_SHOWS/{n}/Season {s}/{n}.{s00e00}.{t}" --db TheTVDB
Personally, I just made this its own shell script.

-!-VERY IMPORTANT NOTE ON RUNNING FILEBOT ON A SYNOLOGY DISKSTATION-!-
Make sure your working directory when you run a filebot script is located on /volume1 or any HDD volume. Filebot seems to store a cache folder and a history.xml file in the working directory it is run from and, for my diskstation at least (DS211), you do not want it writing to any directory on the flash as this is very slow and over time can burn out your flash. I think it may be possible to set what directory filebot puts these files in at the cmd line or maybe a config file. I'm going to look into that.

Hope this helps!
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot on Synology Diskstation

Post by rednoah »

Did you install MissileHuggers SPK via the Synology Package Manager or my IPK via cmdline ipkg install? I don't maintain the SPK so I'm not sure what they use as startup script.

I recommend using this startup script:

Code: Select all

#!/bin/sh
java -Dunixfs=false -DuseExtendedFileAttributes=false -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dapplication.deployment=spk -Dapplication.dir=$HOME/.filebot -Djava.io.tmpdir=$HOME/.filebot/temp -Djna.library.path=/usr/local/filebot -Djava.library.path=/usr/local/filebot -jar /usr/local/filebot/filebot.jar "$@"
I assume your $HOME is a good place to store cache/temp/config files, otherwise you can modify application.dir and java.io.tmpdir.

PS: The issue you're talking about was probably caused by using $@ instead of "$@" to pass through arguments.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot on Synology Diskstation

Post by rednoah »

btw I'm running filebot on a headless Linux server and had the problem that unicode filename didn't work properly.

In my case it was because the environment variable LANG wasn't set by default. This is what fixed it for me:

Code: Select all

export LANG=en_US.utf8
:idea: Please read the FAQ and How to Request Help.
User avatar
fry
Posts: 6
Joined: 02 Aug 2014, 16:43

Re: Filebot on Synology Diskstation

Post by fry »

rednoah wrote:In my case it was because the environment variable LANG wasn't set by default. This is what fixed it for me:

Code: Select all

export LANG=en_US.utf8
Very good, this helped me tremendously after hours of trying to figure out why FileBot worked when typing out the command on the command-line and didn't work when trying to trigger the script.
Post Reply