From 79a1186e61c8b2f7b7dfab78a7a86e9695994b02 Mon Sep 17 00:00:00 2001 From: sigma67 Date: Sat, 4 May 2024 13:15:51 +0200 Subject: [PATCH] fix lint --- tests/mixins/test_playlists.py | 2 +- ytmusicapi/parsers/playlists.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/mixins/test_playlists.py b/tests/mixins/test_playlists.py index c6262c7..83c9402 100644 --- a/tests/mixins/test_playlists.py +++ b/tests/mixins/test_playlists.py @@ -89,7 +89,7 @@ def test_edit_playlist(self, config, yt_brand): ) assert response == "STATUS_SUCCEEDED", "Playlist edit failed" - def test_end2end(self, config, yt_brand, sample_video): + def test_end2end(self, yt_brand, sample_video): playlist_id = yt_brand.create_playlist( "test", "test description", diff --git a/ytmusicapi/parsers/playlists.py b/ytmusicapi/parsers/playlists.py index 46dc0df..699a73b 100644 --- a/ytmusicapi/parsers/playlists.py +++ b/ytmusicapi/parsers/playlists.py @@ -6,12 +6,14 @@ def parse_playlist_header(response: Dict) -> Dict[str, Any]: playlist: Dict[str, Any] = {} - header = nav(response, HEADER_DETAIL) editable_header = nav(response, [*HEADER, *EDITABLE_PLAYLIST_DETAIL_HEADER], True) playlist["owned"] = editable_header is not None playlist["privacy"] = "PUBLIC" - if editable_header is not None: + if editable_header is not None: # owned playlist + header = nav(editable_header, HEADER_DETAIL) playlist["privacy"] = editable_header["editHeader"]["musicPlaylistEditHeaderRenderer"]["privacy"] + else: + header = nav(response, HEADER_DETAIL, True) playlist["title"] = nav(header, TITLE_TEXT) playlist["thumbnails"] = nav(header, THUMBNAIL_CROPPED)