From d1ac87ce6e1afe2e0c06c130c74f6a2a036e18fc Mon Sep 17 00:00:00 2001 From: sigma67 Date: Tue, 2 Jan 2024 21:52:36 +0100 Subject: [PATCH] get_user_playlists: no longer errors on empty profile --- ytmusicapi/mixins/browsing.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ytmusicapi/mixins/browsing.py b/ytmusicapi/mixins/browsing.py index 75b49bbc..a013e452 100644 --- a/ytmusicapi/mixins/browsing.py +++ b/ytmusicapi/mixins/browsing.py @@ -340,7 +340,10 @@ def get_user_playlists(self, channelId: str, params: str) -> List[Dict]: endpoint = "browse" body = {"browseId": channelId, "params": params} response = self._send_request(endpoint, body) - results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + GRID_ITEMS) + results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + GRID_ITEMS, True) + if not results: + return [] + user_playlists = parse_content_list(results, parse_playlist) return user_playlists