If subtitle not found then ...

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
gavdari
Posts: 8
Joined: 11 Mar 2013, 21:56

If subtitle not found then ...

Post by gavdari »

Hi,
I've got a script that I run on newly downloaded episodes which should find the subtitle and rename the files accordingly. What I want to do is for the script to quit when no subtitle is found. How should I do that? Currently, I'm using the following to find the subtitles:

Code: Select all

filebot -get-missing-subtitles "$1" --lang en -non-strict
User avatar
rednoah
The Source
Posts: 23020
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: If subtitle not found then ...

Post by rednoah »

You could try using the Exit Code but I think on Windows it doesn't work properly.

Best bet is a little Groovy script:
http://www.filebot.net/script.html

Pseudo Code:

Code: Select all

subs = getMissingSubtitles()
if subs not empty {
   rename()
}
:idea: Please read the FAQ and How to Request Help.
gavdari
Posts: 8
Joined: 11 Mar 2013, 21:56

Re: If subtitle not found then ...

Post by gavdari »

Thank you for the reply.
I'm running this on linux, actually it's a right click action and I'd like to avoid calling another script as much as possible.

Code: Select all

subs=filebot -get-missing-subtitles 
doesn't work. How should I do it in a shell script?
User avatar
rednoah
The Source
Posts: 23020
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: If subtitle not found then ...

Post by rednoah »

Then you can probably simply && the two calls:

Code: Select all

Command A && Command B
You can read up on how && works exactly on google.
:idea: Please read the FAQ and How to Request Help.
Post Reply