From cfdb040652f8cdc5b34da7258c927ab74f8d4c3f Mon Sep 17 00:00:00 2001 From: sigma67 Date: Mon, 14 Dec 2020 14:18:13 +0100 Subject: [PATCH] Update get_artist to work with MPLA IDs now returned by get_library_artists (closes #117) --- tests/test.py | 2 +- ytmusicapi/mixins/browsing.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test.py b/tests/test.py index 87b0b02..46145af 100644 --- a/tests/test.py +++ b/tests/test.py @@ -49,7 +49,7 @@ class TestYTMusic(unittest.TestCase): self.assertGreater(len(results), 20) def test_get_artist(self): - results = youtube.get_artist("UCmMUZbaYdNH0bEd1PAlAqsA") + results = youtube.get_artist("MPLAUCmMUZbaYdNH0bEd1PAlAqsA") self.assertEqual(len(results), 11) results = youtube.get_artist("UCLZ7tlKC06ResyDmEStSrOw") # no album year self.assertGreaterEqual(len(results), 9) diff --git a/ytmusicapi/mixins/browsing.py b/ytmusicapi/mixins/browsing.py index 1060a36..55ab8c8 100644 --- a/ytmusicapi/mixins/browsing.py +++ b/ytmusicapi/mixins/browsing.py @@ -201,6 +201,8 @@ class BrowsingMixin: } } """ + if channelId.startswith("MPLA"): + channelId = channelId[4:] body = prepare_browse_endpoint("ARTIST", channelId) endpoint = 'browse' response = self._send_request(endpoint, body)