From 4de1343b9404b6ee722782fc03de10cd691417a9 Mon Sep 17 00:00:00 2001 From: HugoBDesigner Date: Wed, 18 Mar 2026 12:15:54 -0300 Subject: [PATCH] Bad Regex Begone! --- panorama_captions_converter/convert_captions_to_panorama.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panorama_captions_converter/convert_captions_to_panorama.py b/panorama_captions_converter/convert_captions_to_panorama.py index f02d713..5a54cb1 100644 --- a/panorama_captions_converter/convert_captions_to_panorama.py +++ b/panorama_captions_converter/convert_captions_to_panorama.py @@ -26,7 +26,7 @@ # detect language of captions try: - fileLanguage = re.search(r'\s*\"([^\"]+)\"\s+\"([^\"]+)\"', lines[2]).group(2) + fileLanguage = re.search(r'"Language"\s+"([^"]+)', lines[2]).group(1) print(f"\n=== Detected caption language: {fileLanguage}") except Exception as e: print(f"=== Error detecting caption language, defaulting to 'english' ({e})")