Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_playlist() format update #562

Closed
heisen273 opened this issue Mar 10, 2024 · 13 comments · Fixed by #573
Closed

get_playlist() format update #562

heisen273 opened this issue Mar 10, 2024 · 13 comments · Fixed by #573
Labels
a/b This issue is caused by a server-side A/B test yt-update A server-side change caused this issue

Comments

@heisen273
Copy link

(Issue originated from this comment).

Currently get_playlist() breaks with same KeyError as in #544
@sigma67 , As per your request, here's playlist screenshot
Screenshot 2024-03-10 at 12 35 42

and full response dict:
response.json

@heisen273 heisen273 changed the title get_playlsit() format update get_playlist() format update Mar 10, 2024
@sigma67
Copy link
Owner

sigma67 commented Mar 10, 2024

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

@sigma67 sigma67 added the yt-update A server-side change caused this issue label Mar 10, 2024
@sigma67
Copy link
Owner

sigma67 commented 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.

@sigma67 sigma67 added the a/b This issue is caused by a server-side A/B test label Mar 13, 2024
@heisen273
Copy link
Author

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

@jbrodriguez
Copy link

jbrodriguez commented 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 🤷‍♂️

@sigma67
Copy link
Owner

sigma67 commented 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

@jbrodriguez
Copy link

@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

@sigma67
Copy link
Owner

sigma67 commented 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

@apastel
Copy link
Contributor

apastel commented Apr 4, 2024

Public playlist:
public_playlist.json

Private playlist:
private_playlist.json

Let me know if you need anything else 🤝

@sigma67
Copy link
Owner

sigma67 commented 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?

sigma67 added a commit that referenced this issue Apr 5, 2024
@sigma67 sigma67 mentioned this issue Apr 5, 2024
@apastel
Copy link
Contributor

apastel commented Apr 5, 2024

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

@sigma67
Copy link
Owner

sigma67 commented 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?

@apastel
Copy link
Contributor

apastel commented 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.

@hundredfire
Copy link

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

sigma67 added a commit that referenced this issue May 4, 2024
sigma67 added a commit that referenced this issue May 4, 2024
* fix #562

* fix test

* use correct public test data

* fix up for new format

* fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a/b This issue is caused by a server-side A/B test yt-update A server-side change caused this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants