mirror of
https://github.com/devine-dl/devine.git
synced 2025-04-29 17:49:44 +00:00
Use same output subtitle format as input codec to SubtitleEdit calls
This commit is contained in:
parent
7cc7227f8c
commit
e7e18a4204
@ -358,10 +358,16 @@ class Subtitle(Track):
|
|||||||
|
|
||||||
executable = get_binary_path("SubtitleEdit")
|
executable = get_binary_path("SubtitleEdit")
|
||||||
if executable:
|
if executable:
|
||||||
|
if self.codec == Subtitle.Codec.SubStationAlphav4:
|
||||||
|
output_format = "AdvancedSubStationAlpha"
|
||||||
|
elif self.codec == Subtitle.Codec.TimedTextMarkupLang:
|
||||||
|
output_format = "TimedText1.0"
|
||||||
|
else:
|
||||||
|
output_format = self.codec.name
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[
|
[
|
||||||
executable,
|
executable,
|
||||||
"/Convert", self.path, "srt",
|
"/Convert", self.path, output_format,
|
||||||
"/encoding:utf8",
|
"/encoding:utf8",
|
||||||
"/overwrite",
|
"/overwrite",
|
||||||
"/RemoveTextForHI"
|
"/RemoveTextForHI"
|
||||||
@ -393,10 +399,17 @@ class Subtitle(Track):
|
|||||||
if not executable:
|
if not executable:
|
||||||
raise EnvironmentError("SubtitleEdit executable not found...")
|
raise EnvironmentError("SubtitleEdit executable not found...")
|
||||||
|
|
||||||
|
if self.codec == Subtitle.Codec.SubStationAlphav4:
|
||||||
|
output_format = "AdvancedSubStationAlpha"
|
||||||
|
elif self.codec == Subtitle.Codec.TimedTextMarkupLang:
|
||||||
|
output_format = "TimedText1.0"
|
||||||
|
else:
|
||||||
|
output_format = self.codec.name
|
||||||
|
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[
|
[
|
||||||
executable,
|
executable,
|
||||||
"/Convert", self.path, "srt",
|
"/Convert", self.path, output_format,
|
||||||
"/ReverseRtlStartEnd",
|
"/ReverseRtlStartEnd",
|
||||||
"/encoding:utf8",
|
"/encoding:utf8",
|
||||||
"/overwrite"
|
"/overwrite"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user