fix(subs): strip whitespace from ASS font names
Use removeprefix instead of removesuffix and add strip() to handle ASS subtitle files that have spaces after commas in Style definitions. Fixes #57
This commit is contained in:
@@ -1567,7 +1567,7 @@ class dl:
|
||||
if subtitle.codec == Subtitle.Codec.SubStationAlphav4:
|
||||
for line in subtitle.path.read_text("utf8").splitlines():
|
||||
if line.startswith("Style: "):
|
||||
font_names.append(line.removesuffix("Style: ").split(",")[1])
|
||||
font_names.append(line.removeprefix("Style: ").split(",")[1].strip())
|
||||
|
||||
font_count, missing_fonts = self.attach_subtitle_fonts(
|
||||
font_names, title, temp_font_files
|
||||
|
||||
Reference in New Issue
Block a user