Closed snp88 closed 3 years ago
maybe this can help
@snp88 can you try to upgrade to v3.6.20, it should resolve your problem. Can you confirm
@Darkfull-Dante
Looks good on v3.6.20
I believe you were seeing this error because an invalid "playlist_type" value was passed to the method. By design the new functionality must accept any string and pass this through to spotify API. To get your saved playlists you should pass user
or default
and not playlists
. The previous functionality always returned user playlists if you passed an arbitrary string.
Valid values are: user
, or default
for user chosen saved playlists, featured
for spotify "featured" playlists, and then any custom view that exists for your user such as discover-weekly
recently-played
, etc.
@snp88 Were you manually calling the get_playlists method with "playlists" as the argument? or perhaps this was some spotcast setup/initialize call?
I also had this issue with the playlists sensor with v3.6.19. Sensor is back after update. Log errors appeared on startup before any spotcast service calls.
Thanks @jazzyisj okay so it's for users who have:
sensor:
- platform: spotcast
in their config (I did not), and I can see in sensor.py it is calling get_playlists with "playlists" which is a little strange because it doesn't follow what is expected from spotcast controller!
Anyway, it's a simple fix we can get in.
@gmcmicken @snp88 to be completely honest its fully my fault, I completely forgot to activate the sensor when doing QA. I'll work on a proper QA procedure that we can add in our documentation, so we don't make silly mistaken like this one. Sorry for any inconvenient that the bad release might have caused
@Darkfull-Dante just confirming I have updated to 3.6.21 and all seems ok.
Thank you for the rapid bugfix!
@Darkfull-Dante Good job Spotcast work like a charm 👍
Describe the bug A clear and concise description of what the bug is.
Describe the bug After last update v3.6.19 new error apper Can't get playlist
Debug log
2021-11-04 10:50:44 ERROR (SyncWorker_7) [spotipy.client] HTTP Error for GET to https://api.spotify.com/v1/views/playlists returned 404 due to Not found. 2021-11-04 10:50:44 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.playlists_sensor fails Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/spotipy/client.py", line 245, in _internal_call response.raise_for_status() File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 953, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.spotify.com/v1/views/playlists?content_limit=10&locale=en&platform=web&types=album%2Cplaylist%2Cartist%2Cshow%2Cstation&limit=10&offset=0 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 468, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 658, in async_device_update raise exc File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/spotcast/sensor.py", line 98, in update resp = self.hass.data[DOMAIN]["controller"].get_playlists( File "/config/custom_components/spotcast/spotcast_controller.py", line 293, in get_playlists resp = client._get( File "/usr/local/lib/python3.9/site-packages/spotipy/client.py", line 291, in _get return self._internal_call("GET", url, payload, kwargs) File "/usr/local/lib/python3.9/site-packages/spotipy/client.py", line 261, in _internal_call raise SpotifyException( spotipy.exceptions.SpotifyException: http status: 404, code:-1 - https://api.spotify.com/v1/views/playlists?content_limit=10&locale=en&platform=web&types=album%2Cplaylist%2Cartist%2Cshow%2Cstation&limit=10&offset=0: Not found., reason: None
Environment (please complete the following information):
Configuration Add your configuration
Additional context Add any other context about the problem here.