From 3c1c408ccd28349c28530493d2fe9904bdcd414e Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Fri, 29 Dec 2023 16:23:04 +0000 Subject: [PATCH] Remove forced removal of Multi-Language SRT header Services needing this done should apply it themselves, e.g. OnMultiplex. A convenience function to do it is available now as `Subtitle.remove_multi_lang_srt_header()`, so you can do e.g., `subtitle.OnMultiplex = remove_multi_lang_srt_header` and it will pass through this function just before muxing. --- devine/commands/dl.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/devine/commands/dl.py b/devine/commands/dl.py index 352f3ef..92bd6df 100644 --- a/devine/commands/dl.py +++ b/devine/commands/dl.py @@ -600,11 +600,8 @@ class dl: subtitle.merge_same_cues(caption_set) subtitle_text = writer().write(caption_set) - if sub_format == Subtitle.Codec.SubRip: - # NOW sometimes has this, when it isn't, causing mux problems - subtitle_text = subtitle_text.replace("MULTI-LANGUAGE SRT\n", "") - subtitle.path.write_text(subtitle_text, encoding="utf8") + subtitle.codec = sub_format subtitle.move(subtitle.path.with_suffix(f".{sub_format.value.lower()}"))