From 01f38878dccb1d82d11b8c73a2772582c6ae61af Mon Sep 17 00:00:00 2001 From: Fabian Wunsch Date: Mon, 25 Sep 2023 21:59:27 +0200 Subject: [PATCH] Singles still use the grid renderer, while albums use the carousel now --- ytmusicapi/mixins/browsing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ytmusicapi/mixins/browsing.py b/ytmusicapi/mixins/browsing.py index 5a1e25b..7725ffd 100644 --- a/ytmusicapi/mixins/browsing.py +++ b/ytmusicapi/mixins/browsing.py @@ -252,7 +252,11 @@ class BrowsingMixin: body = {"browseId": channelId, "params": params} endpoint = 'browse' response = self._send_request(endpoint, body) - results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + CAROUSEL_CONTENTS) + results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM) + if 'gridRenderer' in results: + results = nav(results, GRID_ITEMS) + else: + results = nav(results, CAROUSEL_CONTENTS) albums = parse_albums(results) return albums