From 0127507abde89e7456e029fe5d4b51af6c42df36 Mon Sep 17 00:00:00 2001 From: OzGav Date: Mon, 3 Nov 2025 10:20:21 +1000 Subject: [PATCH] Fix HLS radio stream playback and exception handling (#2585) --- music_assistant/helpers/playlists.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/music_assistant/helpers/playlists.py b/music_assistant/helpers/playlists.py index 1fa645c6..aac79966 100644 --- a/music_assistant/helpers/playlists.py +++ b/music_assistant/helpers/playlists.py @@ -84,7 +84,12 @@ def parse_m3u(m3u_data: str) -> list[PlaylistItem]: kev_value_parts = part.strip().split("=") stream_info[kev_value_parts[0]] = kev_value_parts[1] elif line.startswith("#EXT-X-KEY:"): - key = line.split(",URI=")[1].strip('"') + # Extract encryption key URI if present + # METHOD=NONE means no encryption, so explicitly clear the key + if "METHOD=NONE" in line: + key = None + elif ",URI=" in line: + key = line.split(",URI=")[1].strip('"') elif line.startswith("#"): # Ignore other extensions continue -- 2.34.1