Use -nobom with CCExtractor

This commit is contained in:
rlaphoenix 2023-03-27 19:25:21 +01:00
parent 527cd4cca1
commit 5b7fadbc55
1 changed files with 5 additions and 7 deletions

View File

@ -213,8 +213,11 @@ class Video(Track):
try: try:
subprocess.run([ subprocess.run([
executable, executable,
"-trim", "-noru", "-ru1", "-trim",
self.path, "-o", out_path "-nobom",
"-noru", "-ru1",
"-o", out_path,
self.path
], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
out_path.unlink(missing_ok=True) out_path.unlink(missing_ok=True)
@ -222,11 +225,6 @@ class Video(Track):
raise raise
if out_path.exists(): if out_path.exists():
if out_path.stat().st_size <= 3:
# An empty UTF-8 file with BOM is 3 bytes.
# If the subtitle file is empty, mkvmerge will fail to mux.
out_path.unlink()
return None
cc_track = Subtitle( cc_track = Subtitle(
id_=track_id, id_=track_id,
url="", # doesn't need to be downloaded url="", # doesn't need to be downloaded