Skip to content

Commit

Permalink
fix(dl): Automatically convert TTML Subs to WebVTT for MKV support
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaphoenix committed Apr 24, 2024
1 parent f231000 commit 3bfd96d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions devine/commands/dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,11 +614,14 @@ def result(
break
video_track_n += 1

if sub_format:
with console.status(f"Converting Subtitles to {sub_format.name}..."):
for subtitle in title.tracks.subtitles:
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 = []
Expand Down

0 comments on commit 3bfd96d

Please sign in to comment.