[GH-ISSUE #562] get_playlist() format update #391

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

Originally created by @heisen273 on GitHub (Mar 10, 2024).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/562

(Issue originated from this comment).

Currently get_playlist() breaks with same KeyError as in https://github.com/sigma67/ytmusicapi/issues/544
@sigma67 , As per your request, here's playlist screenshot
Screenshot 2024-03-10 at 12 35 42

and full response dict:
response.json

Originally created by @heisen273 on GitHub (Mar 10, 2024). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/562 (Issue originated from [this comment](https://github.com/sigma67/ytmusicapi/pull/560#issuecomment-1986976599)). Currently `get_playlist()` breaks with same KeyError as in https://github.com/sigma67/ytmusicapi/issues/544 @sigma67 , As per your request, here's playlist screenshot ![Screenshot 2024-03-10 at 12 35 42](https://github.com/sigma67/ytmusicapi/assets/13763176/f7f9a959-7773-464f-b555-71c8b8632c16) and full response dict: [response.json](https://github.com/sigma67/ytmusicapi/files/14549958/response.json)
kerem 2026-02-27 23:00:33 +03:00
Author
Owner

@sigma67 commented on GitHub (Mar 10, 2024):

Yeah, same issue as with get_album. Thanks for the helpful data

<!-- gh-comment-id:1987305667 --> @sigma67 commented on GitHub (Mar 10, 2024): Yeah, same issue as with get_album. Thanks for the helpful data
Author
Owner

@sigma67 commented on GitHub (Mar 11, 2024):

It seems your screenshot is for a public playlist and your response data for a different private playlist? And the title of the private playlist is Title with description Description?

Could you please also provide response data for a public playlist? And a screenshot for the private one if you don't mind (feel free to copy a public playlist to a private one if you mind the privacy).

It would be helpful to have matching screenshot & response data for both private and public playlist to be able to make some sense of it.

<!-- gh-comment-id:1989032849 --> @sigma67 commented on GitHub (Mar 11, 2024): It seems your screenshot is for a public playlist and your response data for a different private playlist? And the title of the private playlist is Title with description Description? Could you please also provide response data for a public playlist? And a screenshot for the private one if you don't mind (feel free to copy a public playlist to a private one if you mind the privacy). It would be helpful to have matching screenshot & response data for both private and public playlist to be able to make some sense of it.
Author
Owner

@heisen273 commented on GitHub (Mar 14, 2024):

hey, sorry for late reply.
my bad, here's a correct screenshot for provided earlier response.json

Screenshot 2024-03-14 at 08 49 15

and also i've opened playlist for everyone with the link: https://music.youtube.com/playlist?list=PLaZPMsuQNCsWn0iVMtGbaUXO6z-EdZaZm

<!-- gh-comment-id:1996760833 --> @heisen273 commented on GitHub (Mar 14, 2024): hey, sorry for late reply. my bad, here's a correct screenshot for provided earlier response.json <img width="1666" alt="Screenshot 2024-03-14 at 08 49 15" src="https://github.com/sigma67/ytmusicapi/assets/13763176/3e0f7231-3ecb-4bef-9969-d26e02b330f2"> and also i've opened playlist for everyone with the link: https://music.youtube.com/playlist?list=PLaZPMsuQNCsWn0iVMtGbaUXO6z-EdZaZm
Author
Owner

@jbrodriguez commented on GitHub (Mar 25, 2024):

the attached link looks different to me, not sure if it's because i'm not signed in

Screenshot 2024-03-25 at 12 50 22

i'm trying to copy playlists from spotify to yt music, it's not working due to this issue

i tried to adapt https://github.com/sigma67/ytmusicapi/tree/fix-get-album-544, however i'm finding that the structure of the json is quite a bit different from what the code is expecting 🤷‍♂️

<!-- gh-comment-id:2018576773 --> @jbrodriguez commented on GitHub (Mar 25, 2024): the attached link looks different to me, not sure if it's because i'm not signed in ![Screenshot 2024-03-25 at 12 50 22](https://github.com/sigma67/ytmusicapi/assets/1305422/0cd7542d-688f-410a-b607-9e3e540b346b) i'm trying to copy playlists from spotify to yt music, it's not working due to this issue i tried to adapt https://github.com/sigma67/ytmusicapi/tree/fix-get-album-544, however i'm finding that the structure of the json is quite a bit different from what the code is expecting 🤷‍♂️
Author
Owner

@sigma67 commented on GitHub (Mar 26, 2024):

@jbrodriguez you cannot reproduce it with your own account if you're not part of Google's A/B group for this test

You'll have to work with the JSON provided by affected users until the change is generally available

<!-- gh-comment-id:2019480464 --> @sigma67 commented on GitHub (Mar 26, 2024): @jbrodriguez you cannot reproduce it with your own account if you're not part of Google's A/B group for this test You'll have to work with the JSON provided by affected users until the change is generally available
Author
Owner

@jbrodriguez commented on GitHub (Mar 26, 2024):

@sigma67 got it !

i tinkered with it and fixed it for me (i copied playlists of ~500 songs without issues)

here's the patch for the fix, although as you mentioned it may work for my scenario (private playlists), it may not work for a general case (including public playlists)

0001-fix-get_playlist-functionality.patch

i'm posting it here as a reference, because i saw that there's some refactoring already in place regarding the playlist header

<!-- gh-comment-id:2020192033 --> @jbrodriguez commented on GitHub (Mar 26, 2024): @sigma67 got it ! i tinkered with it and fixed it for me (i copied playlists of ~500 songs without issues) here's the patch for the fix, although as you mentioned it may work for my scenario (private playlists), it may not work for a general case (including public playlists) [0001-fix-get_playlist-functionality.patch](https://github.com/sigma67/ytmusicapi/files/14757671/0001-fix-get_playlist-functionality.patch) i'm posting it here as a reference, because i saw that there's some refactoring already in place regarding the playlist header
Author
Owner

@sigma67 commented on GitHub (Apr 4, 2024):

You guys could help by providing more test data:

  • private playlist response.json
  • public playlist response.json

So far I only have a private playlist from a comment by @heisen273

CC @apastel

<!-- gh-comment-id:2037906381 --> @sigma67 commented on GitHub (Apr 4, 2024): You guys could help by providing more test data: - private playlist response.json - public playlist response.json So far I only have a private playlist from a comment by @heisen273 CC @apastel
Author
Owner

@apastel commented on GitHub (Apr 4, 2024):

Public playlist:
public_playlist.json

Private playlist:
private_playlist.json

Let me know if you need anything else 🤝

<!-- gh-comment-id:2037977498 --> @apastel commented on GitHub (Apr 4, 2024): Public playlist: [public_playlist.json](https://github.com/sigma67/ytmusicapi/files/14875986/public_playlist.json) Private playlist: [private_playlist.json](https://github.com/sigma67/ytmusicapi/files/14875987/private_playlist.json) Let me know if you need anything else :handshake:
Author
Owner

@sigma67 commented on GitHub (Apr 5, 2024):

Hi @apastel, thanks, that's already helpful!

What I meant though is a public playlist that is not owned by you. So the actual distinction here is between an "owned" and a "foreign" playlist, as that will make a difference in how it is presented to the user.

Could you provide a foreign playlist, i.e. one that you do not own, like one generated by YouTube Music?

<!-- gh-comment-id:2040402497 --> @sigma67 commented on GitHub (Apr 5, 2024): Hi @apastel, thanks, that's already helpful! What I meant though is a public playlist that *is not owned by you*. So the actual distinction here is between an "owned" and a "foreign" playlist, as that will make a difference in how it is presented to the user. Could you provide a foreign playlist, i.e. one that you do not own, like one generated by YouTube Music?
Author
Owner

@apastel commented on GitHub (Apr 5, 2024):

Whoops, yes that's an important distinction:
actual_public_playlist.json

<!-- gh-comment-id:2040453235 --> @apastel commented on GitHub (Apr 5, 2024): Whoops, yes that's an important distinction: [actual_public_playlist.json](https://github.com/sigma67/ytmusicapi/files/14889684/actual_public_playlist.json)
Author
Owner

@sigma67 commented on GitHub (Apr 5, 2024):

@apastel are you maybe not in the A/B test anymore? Your data is actually not the new format, but the old one

It has singleColumnBrowseResultsRenderer, not twoColumnBrowseResultsRenderer

If you still have the error, maybe it is a different one? In that case can you screenshot the playlist?

<!-- gh-comment-id:2040489770 --> @sigma67 commented on GitHub (Apr 5, 2024): @apastel are you maybe not in the A/B test anymore? Your data is actually not the new format, but the old one It has `singleColumnBrowseResultsRenderer`, not `twoColumnBrowseResultsRenderer` If you still have the error, maybe it is a different one? In that case can you screenshot the playlist?
Author
Owner

@apastel commented on GitHub (Apr 5, 2024):

My bad (again), I forgot that my failing unit tests are using my "Test Brand" account, and I just gave you a playlist while logged into my personal account.

I can see that this json file contains the twoColumnBrowseResultsRenderer and it has the two-column format in my browser.
actual_public_playlist.json

Let me know if you still need a private two-column playlist.

<!-- gh-comment-id:2040514195 --> @apastel commented on GitHub (Apr 5, 2024): My bad (again), I forgot that my failing unit tests are using my "Test Brand" account, and I just gave you a playlist while logged into my personal account. I can see that this json file contains the `twoColumnBrowseResultsRenderer` and it has the two-column format in my browser. [actual_public_playlist.json](https://github.com/sigma67/ytmusicapi/files/14889974/actual_public_playlist.json) Let me know if you still need a private two-column playlist.
Author
Owner

@hundredfire commented on GitHub (May 2, 2024):

Trying to provide more data:
private playlist screenshot, log and response.json:
private playlist.json
private playlist.log
private playlist

And public playlist files (I'm not the owner):
public playlist.json
public playlist.log
public playlist

<!-- gh-comment-id:2090180282 --> @hundredfire commented on GitHub (May 2, 2024): Trying to provide more data: private playlist screenshot, log and response.json: [private playlist.json](https://github.com/sigma67/ytmusicapi/files/15187096/private.playlist.json) [private playlist.log](https://github.com/sigma67/ytmusicapi/files/15187098/private.playlist.log) ![private playlist](https://github.com/sigma67/ytmusicapi/assets/108155990/cb5ad867-e514-4356-ae56-63860c1b11bc) And public playlist files (I'm not the owner): [public playlist.json](https://github.com/sigma67/ytmusicapi/files/15187106/public.playlist.json) [public playlist.log](https://github.com/sigma67/ytmusicapi/files/15187107/public.playlist.log) ![public playlist](https://github.com/sigma67/ytmusicapi/assets/108155990/aad7829f-f647-4f8c-87a7-bbc95ced70b7)
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#391
No description provided.