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

YouTube Music Playlist Sync Error #1560

Closed
schblondie opened this issue Oct 13, 2023 · 19 comments
Closed

YouTube Music Playlist Sync Error #1560

schblondie opened this issue Oct 13, 2023 · 19 comments
Assignees
Labels
bug Something isn't working

Comments

@schblondie
Copy link

What version of Music Assistant has the issue?

2023.6.0b3

The problem

YouTube Music Playlists don't get loaded as there's an error thrown.

How to reproduce

Hard to say, probably having a song without a required meta data. Could give access to all of my playlist via sharing of needed.

Relevant log output

2023-10-13 17:35:00.233 WARNING (MainThread) [music_assistant.music] Sync task for Felix completed with errors
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 33, in _get_artist
artist = ytm.get_artist(channelId=prov_artist_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/browsing.py", line 239, in get_artist
artist.update(self.parser.parse_artist_contents(results))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/_utils.py", line 78, in _impl
return method(self, *method_args, **method_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/i18n.py", line 42, in parse_artist_contents
artist[category]['results'] = parse_content_list(data[0]['contents'],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/browsing.py", line 47, in parse_content_list
contents.append(parse_func(result[key]))
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/browsing.py", line 108, in parse_video
'videoId': nav(result, NAVIGATION_VIDEO_ID),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 81, in nav
raise err
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 75, in nav
root = root[k]
~~~~^^^
KeyError: 'watchEndpoint'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/music.py", line 576, in run_sync
await provider.sync_library(media_types)
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/models/music_provider.py", line 386, in sync_library
library_item = await controller.add_item_to_library(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/tracks.py", line 148, in add_item_to_library
library_item = await self._add_library_item(item)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/tracks.py", line 376, in _add_library_item
track_artists = await self._get_artist_mappings(item)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 666, in _get_artist_mappings
artist_mapping = await self._get_artist_mapping(artist)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 684, in _get_artist_mapping
artist = await self.mass.music.artists.get_provider_item(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 414, 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 260, in get_item
return await self.get_artist(prov_item_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/init.py", line 307, in get_artist
if artist_obj := await get_artist(prov_artist_id=prov_artist_id, headers=self._headers):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 41, in get_artist
return await asyncio.to_thread(_get_artist)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 37, in _get_artist
user = ytm.get_user(channelId=prov_artist_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/browsing.py", line 311, in get_user
user = {'name': nav(response, ['header', 'musicVisualHeaderRenderer'] + TITLE_TEXT)}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 81, in nav
raise err
File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 75, in nav
root = root[k]
~~~~^^^
KeyError: 'musicVisualHeaderRenderer'

Additional information

No response

What version of Home Assistant Core are your running

2023.10.2

What type of installation are you running?

Home Assistant Supervised

On what type of hardware are you running?

Linux

@OzGav
Copy link
Contributor

OzGav commented Oct 13, 2023

@MarvinSchenkel

@Cheerpipe
Copy link

Cheerpipe commented Oct 16, 2023

Hi.

I have the same error in logs and empty playlist page when YTMusic.

Log output

2023-10-16 19:31:35.841 WARNING (MainThread) [music_assistant.music] Sync task for YouTube Music completed with errors
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 33, in _get_artist
    artist = ytm.get_artist(channelId=prov_artist_id)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/browsing.py", line 239, in get_artist
    artist.update(self.parser.parse_artist_contents(results))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/_utils.py", line 78, in _impl
    return method(self, *method_args, **method_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/i18n.py", line 42, in parse_artist_contents
    artist[category]['results'] = parse_content_list(data[0]['contents'],
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/browsing.py", line 47, in parse_content_list
    contents.append(parse_func(result[key]))
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/browsing.py", line 108, in parse_video
    'videoId': nav(result, NAVIGATION_VIDEO_ID),
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 81, in nav
    raise err
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 75, in nav
    root = root[k]
           ~~~~^^^
KeyError: 'watchEndpoint'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/music.py", line 576, in run_sync
    await provider.sync_library(media_types)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/models/music_provider.py", line 386, in sync_library
    library_item = await controller.add_item_to_library(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/tracks.py", line 148, in add_item_to_library
    library_item = await self._add_library_item(item)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/tracks.py", line 376, in _add_library_item
    track_artists = await self._get_artist_mappings(item)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 666, in _get_artist_mappings
    artist_mapping = await self._get_artist_mapping(artist)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 684, in _get_artist_mapping
    artist = await self.mass.music.artists.get_provider_item(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 414, 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 260, in get_item
    return await self.get_artist(prov_item_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/__init__.py", line 307, in get_artist
    if artist_obj := await get_artist(prov_artist_id=prov_artist_id, headers=self._headers):
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 41, in get_artist
    return await asyncio.to_thread(_get_artist)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 37, in _get_artist
    user = ytm.get_user(channelId=prov_artist_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/browsing.py", line 311, in get_user
    user = {'name': nav(response, ['header', 'musicVisualHeaderRenderer'] + TITLE_TEXT)}
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 81, in nav
    raise err
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 75, in nav
    root = root[k]
           ~~~~^^^
KeyError: 'musicVisualHeaderRenderer'
2023-10-16 19:36:05.705 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-278' coro=<AlbumsController.add_item_to_library() done, defined at /usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/albums.py:91> exception=AssertionError()>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/albums.py", line 104, in add_item_to_library
    await self.mass.metadata.get_album_metadata(item)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/metadata.py", line 145, in get_album_metadata
    if metadata := await provider.get_album_metadata(album):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/theaudiodb/__init__.py", line 138, in get_album_metadata
    assert isinstance(artist, Artist)
AssertionError
2023-10-16 19:36:07.452 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-282' coro=<AlbumsController.add_item_to_library() done, defined at /usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/albums.py:91> exception=AssertionError()>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/albums.py", line 104, in add_item_to_library
    await self.mass.metadata.get_album_metadata(item)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/metadata.py", line 145, in get_album_metadata
    if metadata := await provider.get_album_metadata(album):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/theaudiodb/__init__.py", line 138, in get_album_metadata
    assert isinstance(artist, Artist)
AssertionError
2023-10-16 19:42:49.853 WARNING (MainThread) [music_assistant.webserver] [140610861869840] Disconnected: Received non-Text message.

image

image

@MarvinSchenkel
Copy link
Contributor

Could you make the playlist public and share it with me? Then I can try to figure out what is wrong .

@Cheerpipe
Copy link

Cheerpipe commented Oct 18, 2023

I checked playlists from explore -> playlist and music I liked automatic list shows a blank page (other playlists works well). Problem is this playlist can't be shared nor make it public. ¿May be the problem playlist is too big?

Will check logs when in home.

Edit:

Don't know if related but when trying to open music I liked list from explore->YouTube music->playlists I get this on log:

File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/webserver.py", line 372, in _run_handler                             result = await result                                                              ^^^^^^^^^^^^                                                   File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 187, in get                                     details = await self.get_provider_item(                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                 File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 414, 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 264, 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 328, 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 63, 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 59, 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 184, in get_playlist                                              playlist['tracks'] = parse_playlist_items(results['contents'])                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^          File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/playlists.py", line 25, in parse_playlist_items                                      setVideoId = menu_service['playlistEditEndpoint']['actions'][0][                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^      KeyError: 'setVideoId'

Sorry for the bad formating. I paste it from my phone :/.

Edit:

I found a playlist that refuses to load on music-assistant:

https://music.youtube.com/playlist?list=PLjGbaftmKtfZjtf4pWWuB66l1I2EQs03d&si=eYJ8ClExADGmlInY

Edit

I found another stragne thing in my music library. There is a Frank Sinatra "channel" in my playlist that won't load in playlists.

image

@Cheerpipe
Copy link

Cheerpipe commented Oct 18, 2023

Hi again.

I was trying gathering more data to isolate playlist issues. I adde some try/except ang logging to the code and found the exact items thar are making playlist sync fail.

2023-10-18 11:22:44.961 ERROR (MainThread) [music_assistant.providers.ytmusic] Error while processing library_item: %sTrack(media_type=<MediaType.TRACK: 'track'>, item_id='iUHbbIz20LI', provider='ytmusic', name='Holding on to Sound (feat. Concept)', metadata=MediaItemMetadata(description=None, review=None, explicit=False, images=[MediaItemImage(type=<ImageType.THUMB: 'thumb'>, path='https://lh3.googleusercontent.com/NgwJdSD22241Scn6KyYoh74dt7lvIqprWJ8pKQziPE1vE9rJSq09sp7jdqO1nqca8dsHuuVDMAZI1YTt=w120-h120-l90-rj', provider='url')], genres=None, mood=None, style=None, copyright=None, lyrics=None, ean=None, label=None, links=None, chapters=None, performers=None, preview=None, replaygain=None, popularity=None, last_refresh=None, checksum=None), provider_mappings={ProviderMapping(item_id='iUHbbIz20LI', provider_domain='ytmusic', provider_instance='ytmusic', available=True, audio_format=AudioFormat(content_type=<ContentType.M4A: 'm4a'>, sample_rate=44100, bit_depth=16, channels=2, output_format_str='m4a', bit_rate=320), url=None, isrc=None, barcode=None, details=None)}, favorite=True, sort_name='holding on to sound (feat. concept)', uri='ytmusic://track/iUHbbIz20LI', timestamp_added=0, timestamp_modified=0, duration=338, version='', mbid=None, artists=[ItemMapping(media_type=<MediaType.ARTIST: 'artist'>, item_id='UCcDhtfxguxdHfHMuq-oVAsg', provider='ytmusic', name='Stonebank', version='', sort_name='stonebank', uri='ytmusic://artist/UCcDhtfxguxdHfHMuq-oVAsg', available=True)], album=ItemMapping(media_type=<MediaType.ALBUM: 'album'>, item_id='MPREb_X6scwEU6yX2', provider='ytmusic', name='Holding on to Sound', version='', sort_name='holding on to sound', uri='ytmusic://album/MPREb_X6scwEU6yX2', available=True))
2023-10-18 11:22:46.350 ERROR (MainThread) [music_assistant.providers.ytmusic] Error while processing library_item: %sTrack(media_type=<MediaType.TRACK: 'track'>, item_id='J-QdI3naUJY', provider='ytmusic', name='Out of Time [Sagan Remix] (feat. Eric Lumiere)', metadata=MediaItemMetadata(description=None, review=None, explicit=False, images=[MediaItemImage(type=<ImageType.THUMB: 'thumb'>, path='https://lh3.googleusercontent.com/AixKSWcQqL02eTLd_HI0phvyAHwVw-jNdLvtBh5v60cpTImY4uPa0677_mkA5sFoKFVKsfh6nEqRTEI=w120-h120-l90-rj', provider='url')], genres=None, mood=None, style=None, copyright=None, lyrics=None, ean=None, label=None, links=None, chapters=None, performers=None, preview=None, replaygain=None, popularity=None, last_refresh=None, checksum=None), provider_mappings={ProviderMapping(item_id='J-QdI3naUJY', provider_domain='ytmusic', provider_instance='ytmusic', available=True, audio_format=AudioFormat(content_type=<ContentType.M4A: 'm4a'>, sample_rate=44100, bit_depth=16, channels=2, output_format_str='m4a', bit_rate=320), url=None, isrc=None, barcode=None, details=None)}, favorite=True, sort_name='out of time [sagan remix] (feat. eric lumiere)', uri='ytmusic://track/J-QdI3naUJY', timestamp_added=0, timestamp_modified=0, duration=201, version='', mbid=None, artists=[ItemMapping(media_type=<MediaType.ARTIST: 'artist'>, item_id='UCq346_97fIcWXPiGOtqLPtg', provider='ytmusic', name='Shane 54', version='', sort_name='shane 54', uri='ytmusic://artist/UCq346_97fIcWXPiGOtqLPtg', available=True), ItemMapping(media_type=<MediaType.ARTIST: 'artist'>, item_id='UC6hMIfugSiBFBeeuAIg5Skw', provider='ytmusic', name='Cubicore', version='', sort_name='cubicore', uri='ytmusic://artist/UC6hMIfugSiBFBeeuAIg5Skw', available=True)], album=ItemMapping(media_type=<MediaType.ALBUM: 'album'>, item_id='MPREb_QzHARxDSBJO', provider='ytmusic', name='Out of Time', version='', sort_name='out of time', uri='ytmusic://album/MPREb_QzHARxDSBJO', available=True))
2023-10-18 11:23:24.222 ERROR (MainThread) [music_assistant.providers.ytmusic] Error while processing library_item: %sTrack(media_type=<MediaType.TRACK: 'track'>, item_id='2yIELWjG8Tc', provider='ytmusic', name='We All Lift Together (From "Warframe")', metadata=MediaItemMetadata(description=None, review=None, explicit=False, images=[MediaItemImage(type=<ImageType.THUMB: 'thumb'>, path='https://lh3.googleusercontent.com/28w4IW5WpSlc0amZ52lQKajXHZf4gAIAQ-3pUaBKMjHqefO5uht4vEXT9-JCluPz0yKDcePF2NOxrm8=w120-h120-l90-rj', provider='url')], genres=None, mood=None, style=None, copyright=None, lyrics=None, ean=None, label=None, links=None, chapters=None, performers=None, preview=None, replaygain=None, popularity=None, last_refresh=None, checksum=None), provider_mappings={ProviderMapping(item_id='2yIELWjG8Tc', provider_domain='ytmusic', provider_instance='ytmusic', available=True, audio_format=AudioFormat(content_type=<ContentType.M4A: 'm4a'>, sample_rate=44100, bit_depth=16, channels=2, output_format_str='m4a', bit_rate=320), url=None, isrc=None, barcode=None, details=None)}, favorite=True, sort_name='we all lift together (from "warframe")', uri='ytmusic://track/2yIELWjG8Tc', timestamp_added=0, timestamp_modified=0, duration=152, version='', mbid=None, artists=[ItemMapping(media_type=<MediaType.ARTIST: 'artist'>, item_id='UCm-7mqcQi6y-DEJAE0lOcyA', provider='ytmusic', name='Keith Power', version='', sort_name='keith power', uri='ytmusic://artist/UCm-7mqcQi6y-DEJAE0lOcyA', available=True)], album=ItemMapping(media_type=<MediaType.ALBUM: 'album'>, item_id='MPREb_shhPHn1lEEF', provider='ytmusic', name='We All Lift Together (From "Warframe")', version='', sort_name='we all lift together (from "warframe")', uri='ytmusic://album/MPREb_shhPHn1lEEF', available=True))
2023-10-18 11:23:28.817 ERROR (MainThread) [music_assistant.providers.ytmusic] Error while processing library_item: %sTrack(media_type=<MediaType.TRACK: 'track'>, item_id='omNEyMDF41I', provider='ytmusic', name='The Veldt (feat. Chris James)', metadata=MediaItemMetadata(description=None, review=None, explicit=False, images=[MediaItemImage(type=<ImageType.THUMB: 'thumb'>, path='https://lh3.googleusercontent.com/DuAnnMdqf2fVW_zWqbj2IFbNBVOQgUnuYI1A06gACHLs1uMKMQo76Fy0Pz9e1UpShUcAqG3JiuvRhHitrg=w120-h120-l90-rj', provider='url')], genres=None, mood=None, style=None, copyright=None, lyrics=None, ean=None, label=None, links=None, chapters=None, performers=None, preview=None, replaygain=None, popularity=None, last_refresh=None, checksum=None), provider_mappings={ProviderMapping(item_id='omNEyMDF41I', provider_domain='ytmusic', provider_instance='ytmusic', available=True, audio_format=AudioFormat(content_type=<ContentType.M4A: 'm4a'>, sample_rate=44100, bit_depth=16, channels=2, output_format_str='m4a', bit_rate=320), url=None, isrc=None, barcode=None, details=None)}, favorite=True, sort_name='veldt (feat. chris james)', uri='ytmusic://track/omNEyMDF41I', timestamp_added=0, timestamp_modified=0, duration=695, version='', mbid=None, artists=[ItemMapping(media_type=<MediaType.ARTIST: 'artist'>, item_id='UCL44WZGVf-BU5N0ymCXrpBg', provider='ytmusic', name='deadmau5', version='', sort_name='deadmau5', uri='ytmusic://artist/UCL44WZGVf-BU5N0ymCXrpBg', available=True)], album=ItemMapping(media_type=<MediaType.ALBUM: 'album'>, item_id='MPREb_Yx0OwsITMBA', provider='ytmusic', name='The Veldt EP', version='', sort_name='veldt ep', uri='ytmusic://album/MPREb_Yx0OwsITMBA', available=True))
2023-10-18 11:24:58.914 ERROR (MainThread) [music_assistant.providers.ytmusic] Error while processing library_item: %sTrack(media_type=<MediaType.TRACK: 'track'>, item_id='dGIY1LaO0ao', provider='ytmusic', name='Here Tonight (feat. Collin McLoughlin)', metadata=MediaItemMetadata(description=None, review=None, explicit=False, images=[MediaItemImage(type=<ImageType.THUMB: 'thumb'>, path='https://i.ytimg.com/vi/dGIY1LaO0ao/hq720.jpg', provider='url')], genres=None, mood=None, style=None, copyright=None, lyrics=None, ean=None, label=None, links=None, chapters=None, performers=None, preview=None, replaygain=None, popularity=None, last_refresh=None, checksum=None), provider_mappings={ProviderMapping(item_id='dGIY1LaO0ao', provider_domain='ytmusic', provider_instance='ytmusic', available=True, audio_format=AudioFormat(content_type=<ContentType.M4A: 'm4a'>, sample_rate=44100, bit_depth=16, channels=2, output_format_str='m4a', bit_rate=320), url=None, isrc=None, barcode=None, details=None)}, favorite=True, sort_name='here tonight (feat. collin mcloughlin)', uri='ytmusic://track/dGIY1LaO0ao', timestamp_added=0, timestamp_modified=0, duration=242, version='', mbid=None, artists=[ItemMapping(media_type=<MediaType.ARTIST: 'artist'>, item_id='UCEPEWyV3I8h-YZ553KCedvw', provider='ytmusic', name='Jay Cosmic', version='', sort_name='jay cosmic', uri='ytmusic://artist/UCEPEWyV3I8h-YZ553KCedvw', available=True), ItemMapping(media_type=<MediaType.ARTIST: 'artist'>, item_id='UCJbMv2e4xSU016Y6w6xaFHw', provider='ytmusic', name='Dash Berlin', version='', sort_name='dash berlin', uri='ytmusic://artist/UCJbMv2e4xSU016Y6w6xaFHw', available=True)], album=None)

I get this by make a small edit in music_provider.py:186

                        try:
                          library_item = await controller.add_item_to_library(
                              prov_item, metadata_lookup=False, **extra_kwargs
                          )
                        except:
                          self.logger.error("Error while processing playlist: %s" + str(prov_item))
                          continue

After this playlist sync works. Hope this hekps you to find a solution.

Music Assistant Playlists
image

Home Assistant Playlists
image

@MarvinSchenkel
Copy link
Contributor

Thanks for this, really helpful! Will debug this once I find some time

@OzGav OzGav added bug Something isn't working and removed triage labels Oct 19, 2023
@oystermon
Copy link

oystermon commented Oct 27, 2023

I got this recently too..

not sure if this PR may help? will give it a go and test
sigma67/ytmusicapi#438

my workaround is to play something else (radio) and reload the playlist

@OzGav
Copy link
Contributor

OzGav commented Oct 27, 2023

@MarvinSchenkel does get all fixes from the original library so this will be fixed when we next push out an update...

@OzGav
Copy link
Contributor

OzGav commented Oct 28, 2023

Please check if this has been fixed in beta74

@oystermon
Copy link

beta74 seems to have fixed that.. thanks :)

@schblondie
Copy link
Author

schblondie commented Nov 5, 2023

This error still persist, sorry I did not contribute I was sick and just laying in bed. I'm running the beta74. Maybe will look into it myself as I'm having alot of playlists and not sure which one is causing it.

2023-11-05 03:02:05.746 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-485' coro=<AlbumsController.add_item_to_library() done, defined at /usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/albums.py:91> exception=AssertionError()>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/albums.py", line 104, in add_item_to_library
    await self.mass.metadata.get_album_metadata(item)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/metadata.py", line 145, in get_album_metadata
    if metadata := await provider.get_album_metadata(album):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/theaudiodb/__init__.py", line 138, in get_album_metadata
    assert isinstance(artist, Artist)
AssertionError
2023-11-05 03:04:07.665 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-516' coro=<AlbumsController.add_item_to_library() done, defined at /usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/albums.py:91> exception=AssertionError()>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/albums.py", line 104, in add_item_to_library
    await self.mass.metadata.get_album_metadata(item)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/metadata.py", line 145, in get_album_metadata
    if metadata := await provider.get_album_metadata(album):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/theaudiodb/__init__.py", line 138, in get_album_metadata
    assert isinstance(artist, Artist)
AssertionError
2023-11-05 03:04:17.836 WARNING (MainThread) [music_assistant.music] Sync task for Felix completed with errors
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 33, in _get_artist
    artist = ytm.get_artist(channelId=prov_artist_id)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/browsing.py", line 239, in get_artist
    artist.update(self.parser.parse_artist_contents(results))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/_utils.py", line 78, in _impl
    return method(self, *method_args, **method_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/i18n.py", line 42, in parse_artist_contents
    artist[category]['results'] = parse_content_list(data[0]['contents'],
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/browsing.py", line 47, in parse_content_list
    contents.append(parse_func(result[key]))
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/browsing.py", line 108, in parse_video
    videoId = nav(result, NAVIGATION_VIDEO_ID_2)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 83, in nav
    raise err
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 77, in nav
    root = root[k]
           ~~~~^^^
KeyError: 'queueAddEndpoint'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/music.py", line 570, in run_sync
    await provider.sync_library(media_types)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/models/music_provider.py", line 386, in sync_library
    library_item = await controller.add_item_to_library(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/tracks.py", line 148, in add_item_to_library
    library_item = await self._add_library_item(item)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/tracks.py", line 376, in _add_library_item
    track_artists = await self._get_artist_mappings(item)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 666, in _get_artist_mappings
    artist_mapping = await self._get_artist_mapping(artist)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 684, in _get_artist_mapping
    artist = await self.mass.music.artists.get_provider_item(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 414, 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 260, in get_item
    return await self.get_artist(prov_item_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/__init__.py", line 307, in get_artist
    if artist_obj := await get_artist(prov_artist_id=prov_artist_id, headers=self._headers):
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 41, in get_artist
    return await asyncio.to_thread(_get_artist)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 37, in _get_artist
    user = ytm.get_user(channelId=prov_artist_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/browsing.py", line 312, in get_user
    user = {'name': nav(response, ['header', 'musicVisualHeaderRenderer'] + TITLE_TEXT)}
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 83, in nav
    raise err
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 77, in nav
    root = root[k]
           ~~~~^^^
KeyError: 'musicVisualHeaderRenderer'

@OzGav
Copy link
Contributor

OzGav commented Nov 5, 2023

Have a look and see if you have any music videos in there. If they are on YTM then they should work but just in case have a look for that

@schblondie
Copy link
Author

Im not sure what you mean, I'm using a mix of "official" songs provided by artists as well as user uploads for remixes and co.
But as the traceback suggests the error is generated by ytmusicapi by still not getting the videoID correctly. Another account I have added also uses this kind of playlists (with other tracks) and is working tho.

@schblondie
Copy link
Author

schblondie commented Nov 5, 2023

With the current code base the sync task for playlists fails when there is an error in one of the playlists. Would it be possible (and better) to check each playlists for errors instead, so at least playlists without any issues get shown. I mean it wouldn't directly fix the issue but may prevent some errors if Google decides to magically change some things in the future again and ytmusicapi might get new errors which aren't fixed (yet)

@oystermon
Copy link

Well I'm getting the same errors as schblondie now...

@OzGav OzGav reopened this Nov 6, 2023
@OzGav
Copy link
Contributor

OzGav commented Nov 6, 2023

@MarvinSchenkel any ideas?

@schblondie
Copy link
Author

Another log, maybe this helps. Some error about "musicbrainz ID" is thrown.

2023-12-01 15:31:08.829 WARNING (MainThread) [music_assistant.music] Sync task for Felix completed with errors
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 33, in _get_artist
    artist = ytm.get_artist(channelId=prov_artist_id)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/browsing.py", line 239, in get_artist
    artist.update(self.parser.parse_artist_contents(results))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/_utils.py", line 78, in _impl
    return method(self, *method_args, **method_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/i18n.py", line 42, in parse_artist_contents
    artist[category]['results'] = parse_content_list(data[0]['contents'],
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/browsing.py", line 47, in parse_content_list
    contents.append(parse_func(result[key]))
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/browsing.py", line 108, in parse_video
    videoId = nav(result, NAVIGATION_VIDEO_ID_2)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 83, in nav
    raise err
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 77, in nav
    root = root[k]
           ~~~~^^^
KeyError: 'menuServiceItemRenderer'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/music.py", line 570, in run_sync
    await provider.sync_library(media_types)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/models/music_provider.py", line 386, in sync_library
    library_item = await controller.add_item_to_library(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/tracks.py", line 148, in add_item_to_library
    library_item = await self._add_library_item(item)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/tracks.py", line 376, in _add_library_item
    track_artists = await self._get_artist_mappings(item)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 666, in _get_artist_mappings
    artist_mapping = await self._get_artist_mapping(artist)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 684, in _get_artist_mapping
    artist = await self.mass.music.artists.get_provider_item(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 414, 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 260, in get_item
    return await self.get_artist(prov_item_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/__init__.py", line 307, in get_artist
    if artist_obj := await get_artist(prov_artist_id=prov_artist_id, headers=self._headers):
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 41, in get_artist
    return await asyncio.to_thread(_get_artist)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 37, in _get_artist
    user = ytm.get_user(channelId=prov_artist_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/browsing.py", line 312, in get_user
    user = {'name': nav(response, ['header', 'musicVisualHeaderRenderer'] + TITLE_TEXT)}
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 83, in nav
    raise err
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 77, in nav
    root = root[k]
           ~~~~^^^
KeyError: 'musicVisualHeaderRenderer'
2023-12-01 15:31:17.821 INFO (MainThread) [music_assistant.music] Sync task for Anna completed
2023-12-01 15:31:25.322 INFO (MainThread) [music_assistant.music] Sync task for Papa completed
2023-12-01 15:38:24.433 INFO (MainThread) [music_assistant.players] Player registered: aa:aa:79:7d:82:cf/Denon AVR-X1700H
2023-12-01 15:39:00.400 INFO (MainThread) [music_assistant.metadata] Unable to get musicbrainz ID for artist Pbb Yea
 - using lookup-album(s): Tanz unter Tränen/Tanz unter Tränen
 - using lookup-track(s): Endorphine/Glaube es ist Liebe (feat. BroyS)/Saufen aufm Spielplatz/Sag mir wenn du wach bist (feat. Factoree Collective)/Ich klaue deine Party/Saufen aufm Spielplatz (Techno Remix)/Glaube es ist Liebe (Live Techno Bootleg Remix)/Komm mit/Dope/Irgendwann sortierst du aus/Ringe im Stripclub/Glaube es ist Liebe (SPEED VERSION) (feat. Factoree Collective)/Pusteblume (feat. Factoree Collective)/Tief im Wald/Traum/TRUMAN/Matrix/Vampire/220 aufm Tacho/Eiskalt/KOMA/Endorphine (Fabian Farell Remix)/Honey (Techno Remix) (feat. Factoree Collective)/Koks/Halb 4

2023-12-01 15:39:06.605 INFO (MainThread) [music_assistant.metadata] Unable to get musicbrainz ID for artist Pbb Yea
 - using lookup-album(s): Tanz unter Tränen/Tanz unter Tränen
 - using lookup-track(s): Endorphine/Glaube es ist Liebe (feat. BroyS)/Saufen aufm Spielplatz/Sag mir wenn du wach bist (feat. Factoree Collective)/Ich klaue deine Party/Saufen aufm Spielplatz (Techno Remix)/Glaube es ist Liebe (Live Techno Bootleg Remix)/Komm mit/Dope/Irgendwann sortierst du aus/Ringe im Stripclub/Glaube es ist Liebe (SPEED VERSION) (feat. Factoree Collective)/Pusteblume (feat. Factoree Collective)/Tief im Wald/Traum/TRUMAN/Matrix/Vampire/220 aufm Tacho/Eiskalt/KOMA/Endorphine (Fabian Farell Remix)/Honey (Techno Remix) (feat. Factoree Collective)/Koks/Halb 4

2023-12-01 15:39:07.306 INFO (MainThread) [music_assistant.metadata] Unable to get musicbrainz ID for artist Yung Yury
 - using lookup-album(s): none
 - using lookup-track(s): Sag mir wenn du wach bist (feat. Factoree Collective)/Ghost Town (Remix)/Sag mir wenn du wach bist (feat. Factoree Collective)/Ghost Town (Remix)

2023-12-01 15:39:11.606 INFO (MainThread) [music_assistant.metadata] Unable to get musicbrainz ID for artist DAY 21
 - using lookup-album(s): none
 - using lookup-track(s): none

2023-12-01 15:39:21.813 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-431' coro=<AlbumsController.add_item_to_library() done, defined at /usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/albums.py:91> exception=AssertionError()>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/albums.py", line 104, in add_item_to_library
    await self.mass.metadata.get_album_metadata(item)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/metadata.py", line 145, in get_album_metadata
    if metadata := await provider.get_album_metadata(album):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/theaudiodb/__init__.py", line 138, in get_album_metadata
    assert isinstance(artist, Artist)
AssertionError
2023-12-01 15:40:30.727 INFO (MainThread) [music_assistant.providers.slimproto] Player Denon AVR-X1700H disconnected
2023-12-01 15:42:01.212 INFO (MainThread) [music_assistant.metadata] Unable to get musicbrainz ID for artist Pbb Yea
 - using lookup-album(s): Tanz unter Tränen/Tanz unter Tränen
 - using lookup-track(s): Endorphine/Glaube es ist Liebe (feat. BroyS)/Saufen aufm Spielplatz/Sag mir wenn du wach bist (feat. Factoree Collective)/Ich klaue deine Party/Saufen aufm Spielplatz (Techno Remix)/Glaube es ist Liebe (Live Techno Bootleg Remix)/Komm mit/Dope/Irgendwann sortierst du aus/Ringe im Stripclub/Glaube es ist Liebe (SPEED VERSION) (feat. Factoree Collective)/Pusteblume (feat. Factoree Collective)/Tief im Wald/Traum/TRUMAN/Matrix/Vampire/220 aufm Tacho/Eiskalt/KOMA/Endorphine (Fabian Farell Remix)/Honey (Techno Remix) (feat. Factoree Collective)/Koks/Halb 4

2023-12-01 15:42:03.366 INFO (MainThread) [music_assistant] Loaded music provider Felix
2023-12-01 15:42:07.387 INFO (MainThread) [music_assistant.metadata] Unable to get musicbrainz ID for artist Yung Yury
 - using lookup-album(s): none
 - using lookup-track(s): Sag mir wenn du wach bist (feat. Factoree Collective)/Ghost Town (Remix)/Sag mir wenn du wach bist (feat. Factoree Collective)/Ghost Town (Remix)

2023-12-01 15:42:11.308 INFO (MainThread) [music_assistant.metadata] Unable to get musicbrainz ID for artist Pbb Yea
 - using lookup-album(s): Tanz unter Tränen/Tanz unter Tränen
 - using lookup-track(s): Endorphine/Glaube es ist Liebe (feat. BroyS)/Saufen aufm Spielplatz/Sag mir wenn du wach bist (feat. Factoree Collective)/Ich klaue deine Party/Saufen aufm Spielplatz (Techno Remix)/Glaube es ist Liebe (Live Techno Bootleg Remix)/Komm mit/Dope/Irgendwann sortierst du aus/Ringe im Stripclub/Glaube es ist Liebe (SPEED VERSION) (feat. Factoree Collective)/Pusteblume (feat. Factoree Collective)/Tief im Wald/Traum/TRUMAN/Matrix/Vampire/220 aufm Tacho/Eiskalt/KOMA/Endorphine (Fabian Farell Remix)/Honey (Techno Remix) (feat. Factoree Collective)/Koks/Halb 4

2023-12-01 15:42:11.721 INFO (MainThread) [music_assistant.metadata] Unable to get musicbrainz ID for artist DAY 21
 - using lookup-album(s): none
 - using lookup-track(s): none

2023-12-01 15:42:15.976 WARNING (MainThread) [music_assistant.music] Sync task for Felix completed with errors
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 33, in _get_artist
    artist = ytm.get_artist(channelId=prov_artist_id)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/browsing.py", line 239, in get_artist
    artist.update(self.parser.parse_artist_contents(results))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/_utils.py", line 78, in _impl
    return method(self, *method_args, **method_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/i18n.py", line 42, in parse_artist_contents
    artist[category]['results'] = parse_content_list(data[0]['contents'],
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/browsing.py", line 47, in parse_content_list
    contents.append(parse_func(result[key]))
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/parsers/browsing.py", line 108, in parse_video
    videoId = nav(result, NAVIGATION_VIDEO_ID_2)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 83, in nav
    raise err
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 77, in nav
    root = root[k]
           ~~~~^^^
KeyError: 'menuServiceItemRenderer'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/music.py", line 570, in run_sync
    await provider.sync_library(media_types)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/models/music_provider.py", line 386, in sync_library
    library_item = await controller.add_item_to_library(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/tracks.py", line 148, in add_item_to_library
    library_item = await self._add_library_item(item)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/tracks.py", line 376, in _add_library_item
    track_artists = await self._get_artist_mappings(item)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 666, in _get_artist_mappings
    artist_mapping = await self._get_artist_mapping(artist)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 684, in _get_artist_mapping
    artist = await self.mass.music.artists.get_provider_item(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/base.py", line 414, 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 260, in get_item
    return await self.get_artist(prov_item_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/__init__.py", line 307, in get_artist
    if artist_obj := await get_artist(prov_artist_id=prov_artist_id, headers=self._headers):
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/ytmusic/helpers.py", line 41, in get_artist
    return await asyncio.to_thread(_get_artist)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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 37, in _get_artist
    user = ytm.get_user(channelId=prov_artist_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/mixins/browsing.py", line 312, in get_user
    user = {'name': nav(response, ['header', 'musicVisualHeaderRenderer'] + TITLE_TEXT)}
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 83, in nav
    raise err
  File "/usr/local/lib/python3.11/site-packages/ytmusicapi/navigation.py", line 77, in nav
    root = root[k]
           ~~~~^^^
KeyError: 'musicVisualHeaderRenderer'
2023-12-01 15:42:22.931 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-518' coro=<AlbumsController.add_item_to_library() done, defined at /usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/albums.py:91> exception=AssertionError()>
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/media/albums.py", line 104, in add_item_to_library
    await self.mass.metadata.get_album_metadata(item)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/metadata.py", line 145, in get_album_metadata
    if metadata := await provider.get_album_metadata(album):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/theaudiodb/__init__.py", line 138, in get_album_metadata
    assert isinstance(artist, Artist)
AssertionError

@MarvinSchenkel
Copy link
Contributor

Is this still an issue with the latest beta 78? I just successfully added the playlist to my library:
image

@schblondie
Copy link
Author

No this is fixed in Beta 78! Thank you!

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
Archived in project
Development

No branches or pull requests

5 participants