fix(dl): Automatically convert TTML Subs to WebVTT for MKV support

This commit is contained in:
rlaphoenix 2024-04-24 05:35:24 +01:00
parent f23100077e
commit 3bfd96d53c
1 changed files with 6 additions and 3 deletions

View File

@ -614,11 +614,14 @@ class dl:
break
video_track_n += 1
if sub_format:
with console.status(f"Converting Subtitles to {sub_format.name}..."):
with console.status("Converting Subtitles..."):
for subtitle in title.tracks.subtitles:
if sub_format:
if subtitle.codec != sub_format:
subtitle.convert(sub_format)
elif subtitle.codec == Subtitle.Codec.TimedTextMarkupLang:
# MKV does not support TTML, VTT is the next best option
subtitle.convert(Subtitle.Codec.WebVTT)
with console.status("Checking Subtitles for Fonts..."):
font_names = []