From: Marcel van der Veldt Date: Fri, 21 Feb 2025 00:18:45 +0000 (+0100) Subject: Add useragent to podcastfeed X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=6aae82e86b860ae3c1e9197038c6143ddd8a748a;p=music-assistant-server.git Add useragent to podcastfeed --- diff --git a/music_assistant/providers/podcastfeed/__init__.py b/music_assistant/providers/podcastfeed/__init__.py index 9ced926a..661676f0 100644 --- a/music_assistant/providers/podcastfeed/__init__.py +++ b/music_assistant/providers/podcastfeed/__init__.py @@ -100,7 +100,10 @@ class PodcastMusicprovider(MusicProvider): # ruff: noqa: S310 feed_url = podcastparser.normalize_feed_url(self.config.get_value(CONF_FEED_URL)) self.podcast_id = create_safe_string(feed_url.replace("http", "")) - async with self.mass.http_session.get(feed_url) as response: + # without user agent, some feeds can not be retrieved + # https://github.com/music-assistant/support/issues/3596 + headers = {"User-Agent": "Mozilla/5.0"} + async with self.mass.http_session.get(feed_url, headers=headers) as response: if response.status == 200: feed_data = await response.read() feed_stream = BytesIO(feed_data)