AMC --def exec - filename not escaped under linux

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
la0011
Posts: 5
Joined: 22 Apr 2013, 15:34

AMC --def exec - filename not escaped under linux

Post by la0011 »

I just integrated filebot AMC with Deluge, and it works great!

There's just one problem: I'm trying to process downloaded files with an encoding script, but since the exec part of the AMC script get's the filename and path from the rename log, spaces are not escaped.

Is there an easy way to escape the whole string (file:to), or to add double quotes at the beginning and end?

Cheers

PS I've already added quotes to the script calling amc.groovy, but obviously that doesn't work.
--def "exec=autsmuxer.sh "{file}""
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC --def exec - filename not escaped under linux

Post by rednoah »

Double quotes inside of double quotes? That doesn't work, plenty of explanation in the amc docs:

Code: Select all

--def "exec=autsmuxer.sh "{file}""
Backslash might work, or you play with mixing single and double quotes, it's all on google:

Code: Select all

--def "exec=autsmuxer.sh \"{file}\""
:idea: Please read the FAQ and How to Request Help.
la0011
Posts: 5
Joined: 22 Apr 2013, 15:34

Re: AMC --def exec - filename not escaped under linux

Post by la0011 »

Thanks a lot, I'm one step closer ;) Got a lot to learn about java ...


While it all seems correct, I'm now getting a file not found error.

Example:

Execute: autsmuxer.sh "/mnt/TVShows/Series Name - 1x01 - With Spaces.mkv"
IOException: java.io.IOException: error=2, No such file or directory
java.io.IOException: java.io.IOException: error=2, No such file or directory
at Script2.execute(Script2.groovy:149)
at Script3$_run_closure31.doCall(Script3.groovy:229)
at Script3.run(Script3.groovy:226)
at net.sourceforge.filebot.cli.ScriptShell.evaluate(Unknown Source)
at net.sourceforge.filebot.cli.ScriptShell.runScript(Unknown Source)
at net.sourceforge.filebot.cli.ArgumentProcessor.process(Unknown Source)
at net.sourceforge.filebot.Main.main(Unknown Source)
Failure (°_°)


Running
autsmuxer.sh "/mnt/TVShows/Series Name - 1x01 - With Spaces.mkv"
from the command prompt works just fine.

I googled and read a lot of tutorials and articles, but I can't find a solution.

What could be the problem here? The script isn't, calling filebot without an input file executes the script just fine. Must be the filename.

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

Re: AMC --def exec - filename not escaped under linux

Post by rednoah »

Might not be working on Linux with FileBot 3.6, grab the latest beta and it should work. Read FAQ for how to get the latest jar.
:idea: Please read the FAQ and How to Request Help.
la0011
Posts: 5
Joined: 22 Apr 2013, 15:34

Re: AMC --def exec - filename not escaped under linux

Post by la0011 »

Thanks a lot, I'll give it a try.
la0011
Posts: 5
Joined: 22 Apr 2013, 15:34

Re: AMC --def exec - filename not escaped under linux

Post by la0011 »

I tried with latest Filebot, the result is different, but it still doesn't work.

Now I get:

Execute: autsmuxer.sh "/mnt/TVShows/Series Name - 1x01 - With Spaces.mkv"
Input file: Spaces.mkv" not found.


Maybe there's a way to escape white spaces, brackets etc. in the file path?


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

Re: AMC --def exec - filename not escaped under linux

Post by rednoah »

Is this an error message of autsmuxer.sh?

Code: Select all

Input file: Spaces.mkv" not found.
No idea why quotes would not be escaped. Works fine on Windows and should work on Linux just the same.

EDIT:
Try creating a new groovy script:

Code: Select all

'''autsmuxer.sh "/mnt/TVShows/Series Name - 1x01 - With Spaces.mkv"'''.execute()
EDIT2:
Or maybe single-quotes work better on unix?

EDIT3:
Looks like it doesn't work in the first place. Not possible for now.
http://groovy.codehaus.org/Executing+Ex ... rom+Groovy
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC --def exec - filename not escaped under linux

Post by rednoah »

Try r1620
:idea: Please read the FAQ and How to Request Help.
la0011
Posts: 5
Joined: 22 Apr 2013, 15:34

Re: AMC --def exec - filename not escaped under linux

Post by la0011 »

Fantastic, now it works!

Thanks a lot!!
Post Reply