From: OzGav Date: Mon, 3 Nov 2025 00:20:21 +0000 (+1000) Subject: Fix HLS radio stream playback and exception handling (#2585) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=0127507abde89e7456e029fe5d4b51af6c42df36;p=music-assistant-server.git Fix HLS radio stream playback and exception handling (#2585) --- 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