Update get_artist to work with MPLA IDs now returned by get_library_artists (closes #117)

This commit is contained in:
sigma67 2020-12-14 14:18:13 +01:00
commit cfdb040652
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0
2 changed files with 3 additions and 1 deletions

View file

@ -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)

View file

@ -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)