Fix transcoder utf8 decoder error handling

This commit is contained in:
Julian Mutter 2023-03-19 21:48:22 +01:00
parent ba6e777320
commit 055eb7b04d

View File

@ -294,7 +294,7 @@ def run_and_log_handbrake(dvd: Dvd, command) -> bool:
# Handbrake often exits with returncode 0 even though it logged an error and transcoding was not successful
def check_handbrake_log_for_error(dvd: Dvd):
with open(dvd.log_file, "r") as log_file:
with open(dvd.log_file, "r", encoding="utf-8", errors="ignore") as log_file:
for line in log_file:
if line.startswith("Encode failed"):
return True
@ -328,7 +328,7 @@ def find_series_titles(dvd: Dvd):
if proc.returncode != 0:
return None
stdout = proc.stdout.decode("utf-8", errors="replace")
stdout = proc.stdout.decode("utf-8", errors="ignore")
json_str = ""
in_json = False