import base64


def from_url_safe_stream_id(stream_id: str) -> str:
    """Convert the URLSafe encoded stream id to the corresponding original stream id

    :param stream_id: streamId of the stream to be parsed
    :return: stream id after conversion
    """
    decoded_url_bytes = base64.urlsafe_b64decode(stream_id + "==")
    encoded_str = base64.b64encode(decoded_url_bytes)
    return str(encoded_str, "utf-8")