Expression format problem

Support for Ubuntu and other Desktop Linux distributions
Post Reply
User avatar
schmitty
Posts: 12
Joined: 16 Oct 2019, 11:37

Expression format problem

Post by schmitty » 18 Oct 2019, 05:03

Hi,

Using the following expression:

Code: Select all

filebot -rename -r /rips/tv/Friends/Season\ 01/*.mkv --q "Friends" --db TheMovieDB::TV --action copy --format /rips/tv/{n}\ \({y}\){'/Season '+s}/{n}.{s00e00}.h264-AVC.{bitdepth}\ bit.{ac}\ \[{channels}\].{source}-{vf}
Yields the following error:

Code: Select all

SyntaxError: unexpected char: 0xFFFF
javax.script.ScriptException: SyntaxError: unexpected char: 0xFFFF
	at net.filebot.format.ExpressionFormat.compile(ExpressionFormat.java:85)
	at net.filebot.format.ExpressionFormat.<init>(ExpressionFormat.java:43)
	at net.filebot.format.ExpressionFileFormat.<init>(ExpressionFileFormat.java:13)
	at net.filebot.cli.ArgumentBean.getExpressionFileFormat(ArgumentBean.java:255)
	at net.filebot.cli.ArgumentProcessor.runCommand(ArgumentProcessor.java:124)
	at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:33)
	at net.filebot.Main.main(Main.java:132)

Error (o_O)
It seems to be the

Code: Select all

{'/Season '+s}
portion of the expression failing, as the expression works fine by hard coding the season directory. FWIW, I have even tried using

Code: Select all

{'/Season '+s.pad(2)}
and results in the error

Code: Select all

-bash: syntax error near unexpected token `('
Intel Core i3-4160
Ubuntu 18.04.3 LTS (x64)

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

Re: Expression format problem

Post by rednoah » 18 Oct 2019, 05:27

You're accidentally mixing bash code and Groovy code without knowing which code is interpreted by whom.

The solution is to pass format expressions via text files instead of passing them on the command line (where bits and pieces my be interpreted by bash without you being aware) or by escaping and quoting things correctly.
:idea: Please read the FAQ and How to Request Help.

User avatar
schmitty
Posts: 12
Joined: 16 Oct 2019, 11:37

Re: Expression format problem

Post by schmitty » 18 Oct 2019, 06:00

Is there an FAQ or something about passing format expressions via text file?
Intel Core i3-4160
Ubuntu 18.04.3 LTS (x64)

User avatar
schmitty
Posts: 12
Joined: 16 Oct 2019, 11:37

Re: Expression format problem

Post by schmitty » 18 Oct 2019, 07:53

Never mind. I was able to solve it, with a bit of trial and error, and referring to different guides.

Here is the working expression:

Code: Select all

filebot -rename -r /rips/tv/Friends/Season\ 01/*.mkv --q "Friends" --db TheMovieDB::TV --action copy --format "/rips/tv/{n} ({y}){'/Season '+s.pad(2)}/{n}.{s00e00}.h264-AVC.{bitdepth} bit.{ac} [{channels}].{source}-{vf}"
Intel Core i3-4160
Ubuntu 18.04.3 LTS (x64)

Post Reply