[GH-ISSUE #184] unfortunately we hit an error in the sub api, please open a ticket #140

Closed
opened 2026-02-27 22:08:15 +03:00 by kerem · 8 comments
Owner

Originally created by @ben0551 on GitHub (Mar 30, 2021).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/184

Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 807, in _update_playlists extra_info = self._api.get_playlist(playlistId=playlist['playlistId']) File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 102, in get_playlist playlist['tracks'].extend(parse_playlist_items(results['contents'])) KeyError: 'contents'

Originally created by @ben0551 on GitHub (Mar 30, 2021). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/184 Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 807, in _update_playlists extra_info = self._api.get_playlist(playlistId=playlist['playlistId']) File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 102, in get_playlist playlist['tracks'].extend(parse_playlist_items(results['contents'])) KeyError: 'contents'
kerem closed this issue 2026-02-27 22:08:15 +03:00
Author
Owner

@sigma67 commented on GitHub (Mar 30, 2021):

Please specify which playlist you were accessing. @KoljaWindeler

<!-- gh-comment-id:810022357 --> @sigma67 commented on GitHub (Mar 30, 2021): Please specify which playlist you were accessing. @KoljaWindeler
Author
Owner

@KoljaWindeler commented on GitHub (Apr 7, 2021):

Just to provide some extra feedback: beginning with version 20210402 my code will printout the exact function call to your api to help debugging.

Not sure if I mentioned that often enough: thanks for all you do!!
I personally listen to music for at least 4h each day ...

<!-- gh-comment-id:814879100 --> @KoljaWindeler commented on GitHub (Apr 7, 2021): Just to provide some extra feedback: beginning with version 20210402 my code will printout the exact function call to your api to help debugging. Not sure if I mentioned that often enough: thanks for all you do!! I personally listen to music for at least 4h each day ...
Author
Owner

@sigma67 commented on GitHub (Apr 7, 2021):

Well thanks for using the API! Seeing it used in so many projects keeps me motivated :)

<!-- gh-comment-id:814884863 --> @sigma67 commented on GitHub (Apr 7, 2021): Well thanks for using the API! Seeing it used in so many projects keeps me motivated :)
Author
Owner

@ben0551 commented on GitHub (Apr 12, 2021):

Please specify which playlist you were accessing. @KoljaWindeler

Sorry for the delay! I get the error all through the day even if no playlist is playing. I have these 3 loaded in the card.

  id: PLiNVoBckLqLlwlfLIh3a4bmuqzLkgEjjt
  id: PLLdPJGHquctFFaYNmcSIZVjpHxjO9dZTS
  id: PLKUA473MWUv2jmkqIxzQR3YL4kuPArj4G
<!-- gh-comment-id:817433798 --> @ben0551 commented on GitHub (Apr 12, 2021): > Please specify which playlist you were accessing. @KoljaWindeler Sorry for the delay! I get the error all through the day even if no playlist is playing. I have these 3 loaded in the card. id: PLiNVoBckLqLlwlfLIh3a4bmuqzLkgEjjt id: PLLdPJGHquctFFaYNmcSIZVjpHxjO9dZTS id: PLKUA473MWUv2jmkqIxzQR3YL4kuPArj4G
Author
Owner

@ben0551 commented on GitHub (Apr 12, 2021):

Current error log:
Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 813, in async_update_playlists extra_info = await self.hass.async_add_executor_job(self._api.get_playlist,playlist['playlistId']) File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 102, in get_playlist playlist['tracks'].extend(parse_playlist_items(results['contents'])) KeyError: 'contents'

<!-- gh-comment-id:817434265 --> @ben0551 commented on GitHub (Apr 12, 2021): Current error log: Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 813, in async_update_playlists extra_info = await self.hass.async_add_executor_job(self._api.get_playlist,playlist['playlistId']) File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 102, in get_playlist playlist['tracks'].extend(parse_playlist_items(results['contents'])) KeyError: 'contents'
Author
Owner

@sigma67 commented on GitHub (Apr 12, 2021):

These playlists can't be the root of the issue, they all work fine. @KoljaWindeler does your code print out the function parameters too?

<!-- gh-comment-id:817596474 --> @sigma67 commented on GitHub (Apr 12, 2021): These playlists can't be the root of the issue, they all work fine. @KoljaWindeler does your code print out the function parameters too?
Author
Owner

@KoljaWindeler commented on GitHub (Apr 12, 2021):

yes it does ... @ben0551 please enable the debug informations (https://github.com/KoljaWindeler/ytube_music_player#debug-information) and paste the log here

<!-- gh-comment-id:817604247 --> @KoljaWindeler commented on GitHub (Apr 12, 2021): yes it does ... @ben0551 please enable the debug informations (https://github.com/KoljaWindeler/ytube_music_player#debug-information) and paste the log here
Author
Owner

@ben0551 commented on GitHub (Apr 12, 2021):

2021-04-13 07:23:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_check_api
2021-04-13 07:23:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - no valid API, try to login
2021-04-13 07:23:07 DEBUG (MainThread) [custom_components.ytube_music_player.const] - login without brand ID
2021-04-13 07:23:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_check_api
2021-04-13 07:23:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - no valid API, try to login
2021-04-13 07:23:07 DEBUG (MainThread) [custom_components.ytube_music_player.const] - login without brand ID
2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - YouTube Api initialized ok, version: 0.15.0
2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_update_selects
2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - Adding 4 player to the dropdown
2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] _update_playlists
2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - YouTube Api initialized ok, version: 0.15.0
2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_update_selects
2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - Adding 6 player to the dropdown
2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] _update_playlists
2021-04-13 07:23:09 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - 1 Playlists loaded
2021-04-13 07:23:09 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - 1 Playlists loaded
2021-04-13 07:23:10 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - Failed to get_playlist count for playlist ID 'LM' setting it to 25
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player]
============= ytube_music_player Integration Error ================
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] and paste the following output:
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
File "/config/custom_components/ytube_music_player/media_player.py", line 813, in async_update_playlists
extra_info = await self.hass.async_add_executor_job(self._api.get_playlist,playlist['playlistId'])
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 102, in get_playlist
playlist['tracks'].extend(parse_playlist_items(results['contents']))
KeyError: 'contents'
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player]
thanks, Kolja
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================
2021-04-13 07:23:10 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_update_playmode
2021-04-13 07:23:10 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - Selection field input_select.ytube_music_player_playmode not found, skipping
2021-04-13 07:23:10 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - Failed to get_playlist count for playlist ID 'LM' setting it to 25
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player]
============= ytube_music_player Integration Error ================
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] and paste the following output:
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
File "/config/custom_components/ytube_music_player/media_player.py", line 813, in async_update_playlists
extra_info = await self.hass.async_add_executor_job(self._api.get_playlist,playlist['playlistId'])
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 102, in get_playlist
playlist['tracks'].extend(parse_playlist_items(results['contents']))
KeyError: 'contents'
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player]
thanks, Kolja
2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================

<!-- gh-comment-id:818279436 --> @ben0551 commented on GitHub (Apr 12, 2021): 2021-04-13 07:23:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_check_api 2021-04-13 07:23:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - no valid API, try to login 2021-04-13 07:23:07 DEBUG (MainThread) [custom_components.ytube_music_player.const] - login without brand ID 2021-04-13 07:23:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_check_api 2021-04-13 07:23:07 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - no valid API, try to login 2021-04-13 07:23:07 DEBUG (MainThread) [custom_components.ytube_music_player.const] - login without brand ID 2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - YouTube Api initialized ok, version: 0.15.0 2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_update_selects 2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - Adding 4 player to the dropdown 2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] _update_playlists 2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - YouTube Api initialized ok, version: 0.15.0 2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_update_selects 2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - Adding 6 player to the dropdown 2021-04-13 07:23:08 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] _update_playlists 2021-04-13 07:23:09 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - 1 Playlists loaded 2021-04-13 07:23:09 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - 1 Playlists loaded 2021-04-13 07:23:10 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - Failed to get_playlist count for playlist ID 'LM' setting it to 25 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================ 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] and paste the following output: 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 813, in async_update_playlists extra_info = await self.hass.async_add_executor_job(self._api.get_playlist,playlist['playlistId']) File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 102, in get_playlist playlist['tracks'].extend(parse_playlist_items(results['contents'])) KeyError: 'contents' 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] thanks, Kolja 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================ 2021-04-13 07:23:10 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] async_update_playmode 2021-04-13 07:23:10 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - Selection field input_select.ytube_music_player_playmode not found, skipping 2021-04-13 07:23:10 DEBUG (MainThread) [custom_components.ytube_music_player.media_player] - Failed to get_playlist count for playlist ID 'LM' setting it to 25 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================ 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] and paste the following output: 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] Traceback (most recent call last): File "/config/custom_components/ytube_music_player/media_player.py", line 813, in async_update_playlists extra_info = await self.hass.async_add_executor_job(self._api.get_playlist,playlist['playlistId']) File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 102, in get_playlist playlist['tracks'].extend(parse_playlist_items(results['contents'])) KeyError: 'contents' 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] thanks, Kolja 2021-04-13 07:23:10 ERROR (MainThread) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================
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#140
No description provided.