FileBot renaming subtitles from .eng.srt to .srt

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
jamauai
Posts: 24
Joined: 20 Oct 2014, 10:33

FileBot renaming subtitles from .eng.srt to .srt

Post by jamauai »

(Run on both OS X 10.10 & Ubuntu 14.04)

The command:

Code: Select all

filebot -rename -get-subtitles --lang en -non-strict --format '{n} - {s00e00} {vf}' The.Good.Wife.S01.720p.WEB-DL.DD5.1.h.264/
The output:

Code: Select all

Get [English] subtitles for 2 files
Looking up subtitles by hash via OpenSubtitles
Matched [The Good Wife - S01E01 720p.mkv] to [The.Good.Wife.S01E01.Pilot.DVDRip.XviD-SAiNTS.HI] via hash
Fetching [The.Good.Wife.S01E01.Pilot.DVDRip.XviD-SAiNTS.HI.srt]
Writing [The.Good.Wife.S01E01.Pilot.DVDRip.XviD-SAiNTS.HI.srt] to [The Good Wife - S01E01 720p.eng.srt]
Looking up subtitles by name via OpenSubtitles
Fetching [the.good.wife.s01e02.srt]
Writing [the.good.wife.s01e02.srt] to [The Good Wife - S01E02 720p.eng.srt]
Filename pattern: [1.00] SxE, [0.00] CWS
Rename episodes using [TheTVDB]
Auto-detected query: [The Good Wife]
Fetching episode data for [The Good Wife]
Auto-detected query: [The Good Wife]
Fetching episode data for [The Good Wife]
[MOVE] Rename [/Users/admin/Desktop/The.Good.Wife.S01.720p.WEB-DL.DD5.1.h.264/The Good Wife - S01E01 720p.eng.srt] to [The Good Wife - S01E01 720p.srt]
[MOVE] Rename [/Users/admin/Desktop/The.Good.Wife.S01.720p.WEB-DL.DD5.1.h.264/The Good Wife - S01E02 720p.eng.srt] to [The Good Wife - S01E02 720p.srt]
...
This is my first time playing with FileBot's CLI and I have to say its amazing. But I can't figure out how to stop it from removing .eng from my .srt files.

BTW I've also tried appending this to the format expression, no success:

Code: Select all

{if (ext == 'srt') '.en'}
Please tell me what I'm doing wrong - Thanks in advance.
User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: FileBot renaming subtitles from .eng.srt to .srt

Post by rednoah »

Your format. Your rules.

Code: Select all

{n} - {s00e00} {vf}{'.'+lang}
:idea: Please read the FAQ and How to Request Help.
jamauai
Posts: 24
Joined: 20 Oct 2014, 10:33

Re: FileBot renaming subtitles from .eng.srt to .srt

Post by jamauai »

Thank you for the quick reply. Ran that and got:

EDIT: the command actually works, the .eng successfully populates before my .srt extensions, so not sure why the error. Maybe its an unnecessary error?

EDIT: ok scratch that, I just realized it doesn't rename my files at all, just downloads the .eng subs. Help..

Code: Select all

ScriptException: SyntaxError: unexpected token: .
javax.script.ScriptException: SyntaxError: unexpected token: .
	at net.filebot.format.ExpressionFormat.compile(ExpressionFormat.java:116)
	at net.filebot.format.ExpressionFormat.<init>(ExpressionFormat.java:74)
	at net.filebot.cli.CmdlineOperations.rename(CmdlineOperations.java:87)
	at net.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:72)
	at net.filebot.Main.main(Main.java:183)
Failure (°_°)
User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: FileBot renaming subtitles from .eng.srt to .srt

Post by rednoah »

If your command is not working, why don't you send me your command?

Here, I'll do it for you:

Code: Select all

--format '{n} - {s00e00} {vf}{'.'+lang}'
Note: This is WRONG

Think about it. This is noob level cmdline mistakes. ;)

@see viewtopic.php?f=4&t=1899
:idea: Please read the FAQ and How to Request Help.
jamauai
Posts: 24
Joined: 20 Oct 2014, 10:33

Re: FileBot renaming subtitles from .eng.srt to .srt

Post by jamauai »

Got it working thanks for your help and excuse my CLI noobness :D

For the record, all I did was replace the outer single quotes with double quotes

So from this:

Code: Select all

--format '{n} - {s00e00} {vf}{'.'+lang}'
To this:

Code: Select all

--format "{n} - {s00e00} {vf}{'.'+lang}"
User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: FileBot renaming subtitles from .eng.srt to .srt

Post by rednoah »

That's how you quote correctly. ;)
:idea: Please read the FAQ and How to Request Help.
Post Reply