From 3663d4504bf0d570e9be4ab3a4e841a6cda8c501 Mon Sep 17 00:00:00 2001 From: John Howe <89397553+timerring@users.noreply.github.com> Date: Thu, 17 Apr 2025 11:25:29 +0800 Subject: [PATCH] fix: expand exception (#291) fix #287 --- src/burn/render_video.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/burn/render_video.py b/src/burn/render_video.py index 8ffc3ac..e2d1c7f 100644 --- a/src/burn/render_video.py +++ b/src/burn/render_video.py @@ -54,17 +54,21 @@ def render_video(video_path): srt_path = original_video_path[:-4] + ".srt" jsonl_path = original_video_path[:-4] + ".jsonl" - # Recoginze the resolution of video - resolution_x, resolution_y = get_resolution(original_video_path) try: + # Recoginze the resolution of video + resolution_x, resolution_y = get_resolution(original_video_path) # Process the danmakus to ass and remove emojis subtitle_font_size, subtitle_margin_v = process_danmakus( xml_path, resolution_x, resolution_y ) - except TypeError as e: - scan_log.error(f"TypeError: {e} - Check the return value of process_danmakus") - except FileNotFoundError as e: - scan_log.error(f"FileNotFoundError: {e} - Check if the file exists") + # except TypeError as e: + # scan_log.error(f"TypeError: {e} - Check the return value of process_danmakus") + # except FileNotFoundError as e: + # scan_log.error(f"FileNotFoundError: {e} - Check if the file exists") + except Exception as e: + scan_log.error(f"Error in process_danmakus: {e}") + subtitle_font_size = "16" + subtitle_margin_v = "60" # Generate the srt file via whisper model if MODEL_TYPE != "pipeline":