YTM: Yield control to event loop during stream url resolution to prevent blocking...
authorMarvin Schenkel <marvinschenkel@gmail.com>
Tue, 18 Nov 2025 13:43:31 +0000 (14:43 +0100)
committerMarvin Schenkel <marvinschenkel@gmail.com>
Tue, 18 Nov 2025 13:43:31 +0000 (14:43 +0100)
music_assistant/providers/ytmusic/__init__.py

index 771eeb1d575767d888a54867a0c7b7f9a171fc2d..24541f2075d9423b67cf395c49a387d73bf6b894 100644 (file)
@@ -988,6 +988,7 @@ class YoutubeMusicProvider(MusicProvider):
 
         def _extract_best_stream_url_format() -> dict[str, Any]:
             yt_dlp = importlib.import_module("yt_dlp")
+            asyncio.sleep(0)  # yield control to event loop
             url = f"{YTM_DOMAIN}/watch?v={item_id}"
             ydl_opts = {
                 "quiet": self.logger.level > logging.DEBUG,