diff --git a/openformats/formats/vtt.py b/openformats/formats/vtt.py index 7ef01ecd..35d4a9cb 100644 --- a/openformats/formats/vtt.py +++ b/openformats/formats/vtt.py @@ -45,7 +45,9 @@ def parse(self, content, **kwargs): self.transcriber.copy_until(len(source)) template = self.transcriber.get_destination() - if not template.startswith("WEBVTT"): + if len(stringset) == 0: + raise ParseError("There are no strings to translate") + elif not template.startswith("WEBVTT"): raise ParseError("VTT file should start with 'WEBVTT'!") return template, stringset @@ -101,10 +103,6 @@ def _parse_section(self, offset, section): # Content string_to_translate = "\n".join(src_strings[timings_index + 1 :]) - if string_to_translate == "": - raise ParseError( - f"Subtitle is empty on line {self.transcriber.line_number + 2}" - ) string = OpenString( timings,