KoljaWindeler / ytube_music_player

YouTube music player for homeassistant
341 stars 53 forks source link

Playlist always shows loading #366

Open rugal7699 opened 4 days ago

rugal7699 commented 4 days ago

Is anyone else experiencing an issue where their playlist always shows ‘loading’? Any suggestions or insights would be appreciated!

Log: File "/config/custom_components/ytube_music_player/media_player.py", line 1136, in async_update_playlists self._playlists = await self.hass.async_add_executor_job(lambda: self._api.get_library_playlists(limit=self._trackLimit)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/ytube_music_player/media_player.py", line 1136, in self._playlists = await self.hass.async_add_executor_job(lambda: self._api.get_library_playlists(limit=self._trackLimit)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/ytmusicapi/mixins/library.py", line 33, in get_library_playlists response = self._send_request(endpoint, body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/ytmusicapi/ytmusic.py", line 242, in _send_request raise YTMusicServerError(message + error) ytmusicapi.exceptions.YTMusicServerError: Server returned HTTP 400: Bad Request. Request contains an invalid argument.

wtaferner commented 2 days ago

Yes, there seems to be a new issue. Not sure why, as I have registered two users/devices and it only happens with one and even when I delete it and recreate and restart. I checked the config file and the authentication seems fine (at least I have all the tokens needed). But most likely the other one is still using some kind of cache, otherwise it would not make sense at all.

A different request but the same issue I would say.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1316, in websocket_browse_media
    payload = await player.async_browse_media(media_content_type, media_content_id)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ytube_music_player/media_player.py", line 2155, in async_browse_media
    response = await build_item_response(self, payload)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ytube_music_player/browse_media.py", line 93, in build_item_response
    media = await hass.async_add_executor_job(media_library.get_home, 20)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/ytmusicapi/mixins/browsing.py", line 115, in get_home
    response = self._send_request(endpoint, body)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/ytmusicapi/ytmusic.py", line 242, in _send_request
    raise YTMusicServerError(message + error)
ytmusicapi.exceptions.YTMusicServerError: Server returned HTTP 400: Bad Request.
Request contains an invalid argument.
wtaferner commented 2 days ago

Ok, duplicate of https://github.com/KoljaWindeler/ytube_music_player/issues/364 and the reasoning sounds legit. New encryption which is not yet applied to all users.