srt.tools.normalize¶
Take a badly formatted SRT file and output a strictly valid one.
- normalize(subs, strict)¶
Normalises subtitles.
- Parameters
subs –
Subtitle
objectsstrict (bool) – Whether to enable strict mode, see
Subtitle.to_srt()
for more information
- Returns
A single SRT formatted string, with each input
Subtitle
represented as an SRT block- Return type
- Raises
SRTParseError – If parsing fails.