From b2cba8c3205dd1601ceaecb3e0b9c0b587e8a96d Mon Sep 17 00:00:00 2001 From: gaclove Date: Tue, 13 Jan 2026 07:14:04 +0000 Subject: [PATCH] fix: improve error handling and encoding in LightX2VConfigCombinerV3 for audio stream processing --- nodes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nodes.py b/nodes.py index 12d5b77..be96762 100644 --- a/nodes.py +++ b/nodes.py @@ -1187,8 +1187,8 @@ class LightX2VConfigCombinerV3: ] try: - output = sp.check_output(cmd_probe) - data = json.loads(output.decode("utf-8")) + output = sp.check_output(cmd_probe, encoding="utf-8", errors="replace") + data = json.loads(output) streams = data.get("streams", []) if not streams: raise ValueError(f"Failed to get audio stream information: {input_path}") @@ -1221,7 +1221,7 @@ class LightX2VConfigCombinerV3: output_path, ] - sp.run(cmd, capture_output=True, text=True, check=True) + sp.run(cmd, capture_output=True, text=True, check=True, encoding="utf-8", errors="replace") return True except sp.CalledProcessError as e: @@ -1267,8 +1267,8 @@ class LightX2VConfigCombinerV3: input_path, ] try: - output = sp.check_output(cmd_probe) - data = json.loads(output.decode("utf-8")) + output = sp.check_output(cmd_probe, encoding="utf-8", errors="replace") + data = json.loads(output) streams = data.get("streams", []) if not streams: raise ValueError(f"Failed to get audio stream information: {input_path}")