fix srt file bug

This commit is contained in:
sun-guannan
2025-08-05 16:39:55 +08:00
parent 62ff49af74
commit 9fbe4dc4fe

View File

@@ -80,7 +80,7 @@ def add_subtitle_impl(
raise Exception(f"Failed to download subtitle file: {str(e)}")
elif os.path.isfile(srt_path): # Check if it's a file
try:
with open(srt_path, 'r', encoding='utf-8') as f:
with open(srt_path, 'r', encoding='utf-8-sig') as f:
srt_content = f.read()
except Exception as e:
raise Exception(f"Failed to read local subtitle file: {str(e)}")