From 60e44be43ed17a799c18a13eb11f36c1e2cb1d9d Mon Sep 17 00:00:00 2001 From: Marvin Schenkel Date: Tue, 17 Dec 2024 20:01:14 +0100 Subject: [PATCH] Rewrite YT stream resolver to use web formats. --- music_assistant/providers/ytmusic/__init__.py | 6 +++++- music_assistant/providers/ytmusic/manifest.json | 2 +- requirements_all.txt | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/music_assistant/providers/ytmusic/__init__.py b/music_assistant/providers/ytmusic/__init__.py index c8835156b..2ce809796 100644 --- a/music_assistant/providers/ytmusic/__init__.py +++ b/music_assistant/providers/ytmusic/__init__.py @@ -748,7 +748,11 @@ def _extract_best_stream_url_format() -> dict[str, Any]: "cookiefile": StringIO(self._netscape_cookie), # This enforces a player client and skips unnecessary scraping to increase speed "extractor_args": { - "youtube": {"skip": ["translated_subs", "dash"], "player_client": ["ios"]} + "youtube": { + "skip": ["translated_subs", "dash"], + "player_client": ["web_music"], + "player_skip": ["webpage"], + } }, } with yt_dlp.YoutubeDL(ydl_opts) as ydl: diff --git a/music_assistant/providers/ytmusic/manifest.json b/music_assistant/providers/ytmusic/manifest.json index 165bd5673..d1e523188 100644 --- a/music_assistant/providers/ytmusic/manifest.json +++ b/music_assistant/providers/ytmusic/manifest.json @@ -4,7 +4,7 @@ "name": "YouTube Music", "description": "Support for the YouTube Music streaming provider in Music Assistant.", "codeowners": ["@MarvinSchenkel"], - "requirements": ["ytmusicapi==1.8.2", "yt-dlp==2024.10.7"], + "requirements": ["ytmusicapi==1.8.2", "yt-dlp==2024.12.13"], "documentation": "https://music-assistant.io/music-providers/youtube-music/", "multi_instance": true } diff --git a/requirements_all.txt b/requirements_all.txt index f5f2c154b..e0737dffb 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -44,6 +44,6 @@ sxm==0.2.8 tidalapi==0.8.1 unidecode==1.3.8 xmltodict==0.14.2 -yt-dlp==2024.10.7 +yt-dlp==2024.12.13 ytmusicapi==1.8.2 zeroconf==0.136.2