diff --git a/homeassistant/components/media_player/browse_media.py b/homeassistant/components/media_player/browse_media.py index d1328a851d2..2b046868f16 100644 --- a/homeassistant/components/media_player/browse_media.py +++ b/homeassistant/components/media_player/browse_media.py @@ -44,7 +44,7 @@ def async_process_play_media_url( return media_content_id else: if media_content_id[0] != "/": - raise ValueError("URL is relative, but does not start with a /") + return media_content_id if parsed.query: logging.getLogger(__name__).debug( diff --git a/tests/components/media_player/test_browse_media.py b/tests/components/media_player/test_browse_media.py index 014eeb7dc48..c7ce52eb12a 100644 --- a/tests/components/media_player/test_browse_media.py +++ b/tests/components/media_player/test_browse_media.py @@ -86,8 +86,8 @@ async def test_process_play_media_url(hass: HomeAssistant, mock_sign_path) -> No == "http://example.local:8123/api/tts_proxy/bla" ) - with pytest.raises(ValueError): - async_process_play_media_url(hass, "hello") + # Not changing a URL which is not absolute and does not start with / + async_process_play_media_url(hass, "hello") == "hello" async def test_process_play_media_url_for_addon(