Page 1 of 1

AMC --def exec - filename not escaped under linux

Posted: 22 Apr 2013, 15:43
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}""

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

Posted: 23 Apr 2013, 03:13
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}\""

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

Posted: 27 Apr 2013, 17:30
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

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

Posted: 28 Apr 2013, 00:36
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.

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

Posted: 28 Apr 2013, 13:00
by la0011
Thanks a lot, I'll give it a try.

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

Posted: 30 Apr 2013, 12:29
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

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

Posted: 30 Apr 2013, 12:50
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

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

Posted: 30 Apr 2013, 13:37
by rednoah
Try r1620

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

Posted: 30 Apr 2013, 15:27
by la0011
Fantastic, now it works!

Thanks a lot!!