{"record":{"id":"7151681ba6b88ac0","repo":"streamlit/streamlit","slug":"subtitles-are-not-supported-for-youtube-videos","errorCode":null,"errorMessage":"Subtitles are not supported for YouTube videos.","messagePattern":"Subtitles are not supported for YouTube videos\\.","errorType":"validation","errorClass":"StreamlitAPIException","httpStatus":null,"severity":"error","filePath":"lib/streamlit/elements/media.py","lineNumber":603,"sourceCode":"    proto.type = VideoProto.Type.NATIVE\n\n    if isinstance(data, Path):\n        data = str(data)  # Convert Path to string\n\n    # If it's an absolute URL or relative static URL (and not a local file), use it directly.\n    if (\n        isinstance(data, str)\n        and not os.path.isfile(data)\n        and (\n            url_util.is_url(data, allowed_schemas=(\"http\", \"https\", \"data\"))\n            or url_util.is_relative_static_url(data)\n        )\n    ):\n        if youtube_url := _reshape_youtube_url(data):\n            proto.url = youtube_url\n            proto.type = VideoProto.Type.YOUTUBE_IFRAME\n            if subtitles:\n                raise StreamlitAPIException(\n                    \"Subtitles are not supported for YouTube videos.\"\n                )\n        else:\n            proto.url = data\n    else:\n        _marshall_av_media(coordinates, proto, data, mimetype)\n\n    if subtitles:\n        subtitle_items: list[tuple[str, str | Path | bytes | io.BytesIO]] = []\n\n        # Single subtitle\n        if isinstance(subtitles, (str, bytes, io.BytesIO, Path)):\n            subtitle_items.append((\"default\", subtitles))\n        # Multiple subtitles\n        elif isinstance(subtitles, dict):\n            subtitle_items.extend(subtitles.items())\n        else:\n            raise StreamlitAPIException(","sourceCodeStart":585,"sourceCodeEnd":621,"githubUrl":"https://github.com/streamlit/streamlit/blob/202661fc552db98c2ba0bb0e113d619689baf9de/lib/streamlit/elements/media.py#L585-L621","documentation":"Error \"Subtitles are not supported for YouTube videos.\" thrown in streamlit/streamlit.","triggerScenarios":"Thrown at lib/streamlit/elements/media.py:603 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"202661fc552db98c2ba0bb0e113d619689baf9de","analyzedAt":"2026-08-26T09:13:21.291Z","schemaVersion":2},"datasetVersion":"2026-08-26T14:46:13.012Z"}