streamlit/streamlit · error · StreamlitAPIException

Subtitles are not supported for YouTube videos.

Error message

Subtitles are not supported for YouTube videos.

What it means

Error "Subtitles are not supported for YouTube videos." thrown in streamlit/streamlit.

Source

Thrown at lib/streamlit/elements/media.py:603

    proto.type = VideoProto.Type.NATIVE

    if isinstance(data, Path):
        data = str(data)  # Convert Path to string

    # If it's an absolute URL or relative static URL (and not a local file), use it directly.
    if (
        isinstance(data, str)
        and not os.path.isfile(data)
        and (
            url_util.is_url(data, allowed_schemas=("http", "https", "data"))
            or url_util.is_relative_static_url(data)
        )
    ):
        if youtube_url := _reshape_youtube_url(data):
            proto.url = youtube_url
            proto.type = VideoProto.Type.YOUTUBE_IFRAME
            if subtitles:
                raise StreamlitAPIException(
                    "Subtitles are not supported for YouTube videos."
                )
        else:
            proto.url = data
    else:
        _marshall_av_media(coordinates, proto, data, mimetype)

    if subtitles:
        subtitle_items: list[tuple[str, str | Path | bytes | io.BytesIO]] = []

        # Single subtitle
        if isinstance(subtitles, (str, bytes, io.BytesIO, Path)):
            subtitle_items.append(("default", subtitles))
        # Multiple subtitles
        elif isinstance(subtitles, dict):
            subtitle_items.extend(subtitles.items())
        else:
            raise StreamlitAPIException(

View on GitHub (pinned to 202661fc55)

When it happens

Trigger: Thrown at lib/streamlit/elements/media.py:603 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of streamlit/streamlit@202661fc55 (2026-08-26). Data as JSON: /api/errors/7151681ba6b88ac0. Report an issue: GitHub.