[GH-ISSUE #470] get_album_browse_id() not working for some URLs #351

Closed
opened 2026-02-27 23:00:19 +03:00 by kerem · 2 comments
Owner

Originally created by @bharat-nair on GitHub (Nov 9, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/470

Describe the bug
While using get_album_browse_id() , some playlist URLs do not give any browse_id

To Reproduce
Steps to reproduce the behavior:
YTMusic().get_album_browse_id("OLAK5uy_nbMYyrfeg5ZgknoOsOGBL268hGxtcbnDM") will give an empty string.

Additional context
Upon checking the page source for this particular playlist, (https://music.youtube.com/playlist?list=OLAK5uy_nbMYyrfeg5ZgknoOsOGBL268hGxtcbnDM) the browseId seems to be there but in this string unescaped form:
...x22:\x7b\x22browseId\x22:\x22MPREb_scJdtUCpPE2\x22,\x22b...

Originally created by @bharat-nair on GitHub (Nov 9, 2023). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/470 **Describe the bug** While using `get_album_browse_id()` , some playlist URLs do not give any `browse_id` **To Reproduce** Steps to reproduce the behavior: `YTMusic().get_album_browse_id("OLAK5uy_nbMYyrfeg5ZgknoOsOGBL268hGxtcbnDM")` will give an empty string. **Additional context** Upon checking the page source for this particular playlist, (https://music.youtube.com/playlist?list=OLAK5uy_nbMYyrfeg5ZgknoOsOGBL268hGxtcbnDM) the `browseId` seems to be there but in this string unescaped form: `...x22:\x7b\x22browseId\x22:\x22MPREb_scJdtUCpPE2\x22,\x22b...`
kerem 2026-02-27 23:00:19 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@bharat-nair commented on GitHub (Nov 9, 2023):

Going through the implementation, (L344) perhaps another regex can be added like: re.findall(r"\\x22MPRE.+?\\x22", response.text)

<!-- gh-comment-id:1804239121 --> @bharat-nair commented on GitHub (Nov 9, 2023): Going through the implementation, ([L344](https://github.com/sigma67/ytmusicapi/blob/2d2ab999a283200c89cf5a13a3ccf854b3dcc7f2/ytmusicapi/mixins/browsing.py#L344)) perhaps another regex can be added like: `re.findall(r"\\x22MPRE.+?\\x22", response.text)`
Author
Owner

@sigma67 commented on GitHub (Nov 9, 2023):

Some unicode shenanigans going on, will fix in a moment

<!-- gh-comment-id:1804271646 --> @sigma67 commented on GitHub (Nov 9, 2023): Some unicode shenanigans going on, will fix in a moment
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#351
No description provided.