fix get_album_browse_id (closes #470)

This commit is contained in:
sigma67 2023-11-09 18:40:38 +01:00
commit 07f690b8ae
No known key found for this signature in database
GPG key ID: 1C314227DF0103D0

View file

@ -341,10 +341,10 @@ class BrowsingMixin:
""" """
params = {"list": audioPlaylistId} params = {"list": audioPlaylistId}
response = self._send_get_request(YTM_DOMAIN + "/playlist", params) response = self._send_get_request(YTM_DOMAIN + "/playlist", params)
matches = re.findall(r"\"MPRE.+?\"", response.text) matches = re.search(r"\"MPRE.+?\"", response.text.encode("utf8").decode("unicode_escape"))
browse_id = None browse_id = None
if len(matches) > 0: if matches:
browse_id = matches[0].encode('utf8').decode('unicode-escape').strip('"') browse_id = matches.group().strip('"')
return browse_id return browse_id
def get_album(self, browseId: str) -> Dict: def get_album(self, browseId: str) -> Dict: