Ok, thanks. Two follow up questions.
Is there a list of the language mappings? E.g when I specify --lang
"en", the subtitle would be named foo
.eng.srt
Is there a way to know if filebot successfully downloaded a subtitle? filebot seems to return with return code 0 both whenit finds and when it not finds any subtitle.
I am calling filebot from a python script, and I need to know if it was successfull or not. So far I hacked it by hardcoding "en"->"eng" and checking if the file exists after calling filebot.
Code: Select all
def fetch_subtitle(filename):
print("fetching subtitle for {0}".format(filename))
base = os.path.basename(filename)
noext = filename.rsplit(".", 1)[0]
result = subprocess.call(["filebot", "-get-subtitles", filename, "--q", base,
"--lang", "en", "--output", "srt", "--encoding",
"utf8", "-non-strict", "--format", "{n.upperInitial().space('.')}.{y}.{source}.{vc}-{group}.srt" ])
print("got result from filebot:{0}".format(result))
return has_subtitle_file(filename, langcode="eng")