Automated Media Center - Add standard video format

All about user-defined episode / movie / file name format expressions
Post Reply
Pillendreher
Posts: 3
Joined: 09 Sep 2013, 07:40

Automated Media Center - Add standard video format

Post by Pillendreher »

Hey guys,

I've only been using Filebot for a few days now, so I'm still quite inexperienced concerning this whole stuff. I've been using theAutomated Media Center Script which works like a charm. I have one wish though:

Instead of "Raising Hope - S03E01 - Not Indecent, But Not Quite Decent Enough Proposal", I'd like my files to be renamed to something like "Raising Hope - S03E01 - Not Indecent, But Not Quite Decent Enough Proposal - 1080p".

I tried the following argument which lead to "Warning: Invalid Argument"

Code: Select all

-script fn:amc "D:\Serien_Downloads" --output "D:" -non-strict --def subtitles=en --def "seriesFormat=TV Shows/{n}/{episode.special ? "Special" : "Season "+s.pad(2)}/{n} - {episode.special ? "S00E"+special.pad(2) : s00e00} - {t.replaceAll(/[`´‘’?]/, "'").replaceAll(/[!?.]+$/).replacePart(', Part $1')}{".$lang"} - {vf}''
The last time I really used java was at least five years ago, so I'm a little rusty. Maybe someone could fix the small error for me. Would be really nice :) I'm still trying to get the gist of Groovy, so I don't quite get what all those parts of the argument are doing.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automated Media Center - Add standard video format

Post by rednoah »

Java is not the issue, using cmdline and passing argument correctly is. If there's " in the format you'll need to escape them with \" for windows cmd to parse argument correctly. This is documented excessively, so check the docs again for details.
:idea: Please read the FAQ and How to Request Help.
Pillendreher
Posts: 3
Joined: 09 Sep 2013, 07:40

Re: Automated Media Center - Add standard video format

Post by Pillendreher »

Just had a success with

Code: Select all

--def "seriesFormat=TV Shows/{n}/{episode.special ? 'Special' : 'Season '+s}/{n} - {episode.special ? 'S00E'+special.pad(2)' : s00e00} - {t} - {vf}"
but not with

Code: Select all

--def "seriesFormat=TV Shows/{n}/{episode.special ? "Special" : "Season "+s.pad(2)}/{n} - {episode.special ? "S00E"+special.pad(2) : s00e00} - {t.replaceAll(/[`´‘’?]/, "'").replaceAll(/[!?.]+$/).replacePart(', Part $1')}{".$lang"} - {vf}''
Besides the "replace xxx" at the end, I don't see much differences. Ending up with invalid argument though. What should I escape in this case? The {vf} ? Using {\vf\} didn't help either.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automated Media Center - Add standard video format

Post by rednoah »

Because the first format doesn't contain any " where the second does. Since " is already a console special character arguments get passed wrong.

There is literally a whole paragraph on this issue in the AMC docs for people who don't understand cmd or sh. PLEASE READ TFM
:idea: Please read the FAQ and How to Request Help.
Pillendreher
Posts: 3
Joined: 09 Sep 2013, 07:40

Re: Automated Media Center - Add standard video format

Post by Pillendreher »

I've already read both the paragraph and other threads on this board, but I didn't quite get it. Thx for the explanation, now the 2nd line works as well. AMC is really a magnificent script! :)
Post Reply