From c25860d2da214c4aa9b410706ff77da4772de5ee Mon Sep 17 00:00:00 2001 From: Philipp Spinnler Date: Wed, 18 Sep 2024 17:40:54 +0200 Subject: [PATCH] url encode url --- app/plugins/sonos.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/plugins/sonos.py b/app/plugins/sonos.py index a3df6bd..f006f64 100644 --- a/app/plugins/sonos.py +++ b/app/plugins/sonos.py @@ -1,4 +1,4 @@ -from urllib.parse import urlparse +from urllib.parse import urlencode, urlparse from fastapi import HTTPException, Response import httpx from soco.discovery import by_name @@ -33,8 +33,9 @@ def get_data(): else: artist = current_track["artist"] song = current_track["title"] - base_url = config.get_attribute(["sonos", "album_art_base_url"]) - image = f"{base_url}/sonos/image-proxy/?url={current_track['album_art']}" + base_url = config.get_attribute(["base_url"]) + encoded_album_art = urlencode({"url": current_track["album_art"]}) + image = f"{base_url}/sonos/image-proxy/?{encoded_album_art}" playing = { "artist": artist,