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

Not displaying content of YouTube Music Playlists #1971

Closed
1 task done
canamman opened this issue Mar 3, 2024 · 16 comments
Closed
1 task done

Not displaying content of YouTube Music Playlists #1971

canamman opened this issue Mar 3, 2024 · 16 comments
Assignees
Labels
bug Something isn't working

Comments

@canamman
Copy link

canamman commented Mar 3, 2024

What version of Music Assistant has the issue?

2.0.0b106

What version of the Home Assistant Integration have you got installed?

2024.2.0

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

  • Yes

The problem

Music assistant is lists all playlists and associated thumbnails from my account but when I try to view any playlist it fails to load and the following error message is recorded in the Music Assistant logs. I'm able to browse and play music from both the artists and albums but fails to populate any of the content of any playlist from YouTube Music.

I have tried completely uninstalling Music Assistant Add-on, re-installing the add-on, reconfiguring the music provider, running multiple synchronizations on my library. without success

How to reproduce

Browse to YouTube, playlists and click on any playlist selection

Music Providers

YouTube Music

Player Providers

Chromecast players

Relevant log output

2024-03-03 15:40:41.388 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-19225' coro=<ArtistsController.add_item_to_library() done, defined at /usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/artists.py:60> exception=KeyError('singleColumnBrowseResultsRenderer')>
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/artists.py", line 71, in add_item_to_library
await self.mass.metadata.get_artist_metadata(item)
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/metadata.py", line 126, in get_artist_metadata
artist.mbid = await self.get_artist_mbid(artist)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/metadata.py", line 251, in get_artist_mbid
ref_tracks = await self.mass.music.artists.tracks(artist.item_id, artist.provider)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/artists.py", line 185, in tracks
return await self.get_provider_artist_toptracks(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/artists.py", line 272, in get_provider_artist_toptracks
items = await prov.get_artist_toptracks(item_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/init.py", line 385, in get_artist_toptracks
playlist_tracks = [
^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/init.py", line 385, in
playlist_tracks = [
^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/init.py", line 349, in get_playlist_tracks
playlist_obj = await get_playlist(prov_playlist_id=prov_playlist_id, headers=self._headers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 62, in get_playlist
return await asyncio.to_thread(_get_playlist)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/threads.py", line 25, in to_thread
return await loop.run_in_executor(None, func_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 58, in _get_playlist
playlist = ytm.get_playlist(playlistId=prov_playlist_id, limit=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/playlists.py", line 109, in get_playlist
results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + ["musicPlaylistShelfRenderer"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 103, in nav
raise err
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 97, in nav
root = root[k]
~~~~^^^
KeyError: 'singleColumnBrowseResultsRenderer'
2024-03-03 15:40:43.665 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-19268' coro=<ArtistsController.add_item_to_library() done, defined at /usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/artists.py:60> exception=KeyError('singleColumnBrowseResultsRenderer')>
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/artists.py", line 71, in add_item_to_library
await self.mass.metadata.get_artist_metadata(item)
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/metadata.py", line 126, in get_artist_metadata
artist.mbid = await self.get_artist_mbid(artist)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/metadata.py", line 251, in get_artist_mbid
ref_tracks = await self.mass.music.artists.tracks(artist.item_id, artist.provider)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/artists.py", line 185, in tracks
return await self.get_provider_artist_toptracks(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/artists.py", line 272, in get_provider_artist_toptracks
items = await prov.get_artist_toptracks(item_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/init.py", line 385, in get_artist_toptracks
playlist_tracks = [
^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/init.py", line 385, in
playlist_tracks = [
^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/init.py", line 349, in get_playlist_tracks
playlist_obj = await get_playlist(prov_playlist_id=prov_playlist_id, headers=self._headers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 62, in get_playlist
return await asyncio.to_thread(_get_playlist)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/threads.py", line 25, in to_thread
return await loop.run_in_executor(None, func_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 58, in _get_playlist
playlist = ytm.get_playlist(playlistId=prov_playlist_id, limit=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/playlists.py", line 109, in get_playlist
results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + ["musicPlaylistShelfRenderer"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 103, in nav
raise err
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 97, in nav
root = root[k]
~~~~^^^
KeyError: 'singleColumnBrowseResultsRenderer'
2024-03-03 15:40:44.453 ERROR (MainThread) [music_assistant.webserver] [139865682544720] Error handling message: CommandMessage(message_id=358, command='music/playlists/get_playlist', args={'item_id': '9', 'provider_instance_id_or_domain': 'library'})
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/webserver.py", line 374, in _run_handler
result = await result
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 189, in get
details = await self.get_provider_item(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 442, in get_provider_item
if item := await provider.get_item(self.media_type, item_id):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/models/music_provider.py", line 269, in get_item
return await self.get_playlist(prov_item_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/init.py", line 336, in get_playlist
if playlist_obj := await get_playlist(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 62, in get_playlist
return await asyncio.to_thread(_get_playlist)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/threads.py", line 25, in to_thread
return await loop.run_in_executor(None, func_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 58, in _get_playlist
playlist = ytm.get_playlist(playlistId=prov_playlist_id, limit=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/playlists.py", line 109, in get_playlist
results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + ["musicPlaylistShelfRenderer"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 103, in nav
raise err
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 97, in nav
root = root[k]
~~~~^^^
KeyError: 'singleColumnBrowseResultsRenderer'

Additional information

No response

What version of Home Assistant Core are your running

2024.2.1

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Generic x86-64 (e.g. Intel NUC)

@canamman canamman added the triage label Mar 3, 2024
@OzGav
Copy link
Contributor

OzGav commented Mar 3, 2024

@MarvinSchenkel

@MarvinSchenkel
Copy link
Contributor

Yay, sounds like another fancy edge case in the playlists. Can you easily identify which playlist is causing the problem? Do you for example have a playlist that includes 'weird' entries like videos, podcast episodes etc.? If you have identified the playlist, could you then maybe make it public and share it with me, so I can reproduce the issue and fix it?

@canamman
Copy link
Author

canamman commented Mar 4, 2024

Do you have any suggestions on how to sort out which playlist might be the culprit?

I have 32 playlists in YTM and I'm unable to see the content of any of them within MA. I've looked through them and don't see any with videos or I thought it might be the fact that I had previously uploaded a large catalog of MP3's and some of that content might have been in some of those playlists. I have subsequently deleted all of the uploaded MP3's from my YTM account which would have removed those items from any existing playlist. I've also gone through and unsubscribed from any public playlists and subsequently created them as separate playlists under my YTM account.

Link to Public playlist eg. that I'm unable to view in MA Alternative Playlist

@canamman
Copy link
Author

canamman commented Mar 4, 2024

I have also now noted there was a few playlists that had unavailable tracks, I have subsequently gone through each of the YTM playlists and removed any tracks that were listed as unavailable.

@canamman
Copy link
Author

canamman commented Mar 4, 2024

Just for the sake of testing I created a new playlist in YTM with a single track and I'm experiencing the same issue of being unable to view in MA. The same error is logged
I've shared the playlist
https://music.youtube.com/playlist?list=PLN5xNfAXTEIRC_lY2SlXVneuDrAJlqo19&si=ubJV5t4BLdYUYMly

KeyError: 'singleColumnBrowseResultsRenderer'
2024-03-04 15:52:58.899 ERROR (MainThread) [music_assistant.webserver] [140332018236816] Error handling message: CommandMessage(message_id=26, command='music/playlists/get_playlist', args={'item_id': 'PLN5xNfAXTEIRC_lY2SlXVneuDrAJlqo19', 'provider_instance_id_or_domain': 'ytmusic'})
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/webserver.py", line 374, in _run_handler
result = await result
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 189, in get
details = await self.get_provider_item(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 442, in get_provider_item
if item := await provider.get_item(self.media_type, item_id):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/models/music_provider.py", line 269, in get_item
return await self.get_playlist(prov_item_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/init.py", line 336, in get_playlist
if playlist_obj := await get_playlist(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 62, in get_playlist
return await asyncio.to_thread(_get_playlist)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/threads.py", line 25, in to_thread
return await loop.run_in_executor(None, func_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 58, in _get_playlist
playlist = ytm.get_playlist(playlistId=prov_playlist_id, limit=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/playlists.py", line 109, in get_playlist
results = nav(response, SINGLE_COLUMN_TAB + SECTION_LIST_ITEM + ["musicPlaylistShelfRenderer"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 103, in nav
raise err
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 97, in nav
root = root[k]
~~~~^^^
KeyError: 'singleColumnBrowseResultsRenderer'

@MarvinSchenkel
Copy link
Contributor

Thanks for this ! I will try to reproduce it and fix it when I find some time :-)

@OzGav OzGav added bug Something isn't working and removed triage labels Mar 5, 2024
@shaiger
Copy link

shaiger commented Mar 15, 2024

I am also seeing this issue. YT Music playlists show up empty, browsing instead of using the playlist tab also shows no tracks.
Playlists from other provides (say, SoundCloud), show up just fine.

@MarvinSchenkel
Copy link
Contributor

MarvinSchenkel commented Mar 15, 2024

Is this still an issue on the latest beta? I can add the linked playlist just fine:
image

FYI: I did add some additional logic in this PR that should at least not kill the syncing process of playlists in case an edge case like this is encountered: music-assistant/server#1145

@shaiger
Copy link

shaiger commented Mar 15, 2024

I believe I have the latest beta (2.0.0b109 ). I could not see the content of the playlist also after updating.
I tried to delete the provider and set it up again, but now I can't even get the playlist themselves to be listed.
Correction: after several sync attempts, I can get playlists to show up (every sync brings up ~ a single playlist). The playlist content still doesn't show up.

@MarvinSchenkel
Copy link
Contributor

I believe I have the latest beta (2.0.0b109 ). I could not see the content of the playlist also after updating. I tried to delete the provider and set it up again, but now I can't even get the playlist themselves to be listed. Correction: after several sync attempts, I can get playlists to show up (every sync brings up ~ a single playlist). The playlist content still doesn't show up.

Can you share your logs and maybe send me the YouTube music URL of the Playlist if you have managed to pinpoint the affected Playlist?

@shaiger
Copy link

shaiger commented Mar 15, 2024

I have over 30 playlists, I can't get any of them (content) to show up. Initially I thought it had to do with music I have uploaded into YTM, so I erased the uploaded files - but that did not help.
Here is one of the playlists: https://music.youtube.com/playlist?list=PLuBlddzPSFjH0TewSOOk4CF95AMHXAO_A&si=bk6dFMlH-jmqs_Ny
This playlist does not even show up on the playlist list. I can only get to it through the browse tool, but the content will not show up.
So if there is shared code used for fetching data in browse mode, and in MA playlist view the issue is probably there. Given sync also seems to abort, and require manual encouragements (manual requests) to gradually build the playlist list - the same code/concept may be used there as well. It looks like while problematic song are marked as such, this signal is not used at view time and the whole operation aborts (vs showing only the "legit" content/graying out problematic content).
I will try to get you some logs later.

@shaiger
Copy link

shaiger commented Mar 16, 2024

d5369777_music_assistant_beta_2024-03-16T11-22-51.431Z.log

This is the "liked" auto-playlist, which is the first to be fetched.

@canamman
Copy link
Author

I am seeing similar logs as shaiger now as well after updating to version 2.0.0b111

d5369777_music_assistant_beta_2024-03-16T11-22-51.431Z.log

@canamman
Copy link
Author

My issue has been resolved, playlists are now populating correctly after updating to version 2.0.0b116 and then removing and re-adding YouTube Music provider

@shaiger
Copy link

shaiger commented Apr 5, 2024

No change on my end. I still cannot see playlist content neither through the browse option nor through imported playlists.

@MarvinSchenkel
Copy link
Contributor

No change on my end. I still cannot see playlist content neither through the browse option nor through imported playlists.

Did you try beta 130 and completely removing YTM?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants