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})")