question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

wp_access_token error

See original GitHub issue

I cannot play music anymore. I’m using version v2.2 of Spotcast and Home Assistent 0.99.3.

I get the following error using services under developertools in Home Assistent and using spotify-card.

Log Details (ERROR) Sun Sep 29 2019 17:33:52 GMT+0200 (centraleuropeisk sommartid) "name='wp_access_token', domain=None, path=None" Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service connection.context(msg), File "/usr/src/homeassistant/homeassistant/core.py", line 1234, in async_call await asyncio.shield(self._execute_service(handler, service_call)) File "/usr/src/homeassistant/homeassistant/core.py", line 1261, in _execute_service await self._hass.async_add_executor_job(handler.func, service_call) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/spotcast/__init__.py", line 162, in start_casting access_token, expires = get_spotify_token(username=user, password=pwd) File "/config/custom_components/spotcast/__init__.py", line 85, in get_spotify_token data = st.start_session(username, password) File "/usr/local/lib/python3.7/site-packages/spotify_token.py", line 70, in start_session access_token, expiration_date = _get_access_token(session, cookies) File "/usr/local/lib/python3.7/site-packages/spotify_token.py", line 42, in _get_access_token access_token = response.cookies['wp_access_token'] File "/usr/local/lib/python3.7/site-packages/requests/cookies.py", line 328, in __getitem__ return self._find_no_duplicates(name) File "/usr/local/lib/python3.7/site-packages/requests/cookies.py", line 399, in _find_no_duplicates raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path)) KeyError: "name='wp_access_token', domain=None, path=None"

This is added to configuration.yaml

spotcast:

username: myusername password: mypassword accounts: fredrik: username: myusername password: mypassword philip: username: myusername2 password: mypassword2

custom-cards:spotify-card

client_id: mycliendid limit: 25 random_song: true transfer_playback: true type: ‘custom:spotify-card’

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:31 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
petergpcommented, Sep 30, 2019

Looks like Spotify has changed their authentication so wp_access_token no longer is return as a cookie after logging in as defined in https://github.com/enriquegh/spotify-webplayer-token/blob/c8ebf5811640cc78eb560ac725cb7d944c63f400/spotify_token.py#L42 which spotcast depends on. Confirmed that by sniffing looking at the traffic when logging into https://accounts.spotify.com/login It looks like they instead use a bunch of cookies (sp_ac, sp_key and sp_dc). I’m not sure if they existed before too and if any of them has the value of the access token. This will have to be investigated more. I can try to find time in a few days if @fondberg doesnt beat me to it.

I assume its not possible to obtain a full access token using any official APIs, @fondberg?

5reactions
fondbergcommented, Sep 30, 2019

Oh no! If I am correct this means Spotify changed the way a browser token is retrieved. That is bad as this library uses the unofficial way to get a token because it is required for chromecast devices. I will need to investigate this…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Donor receiving “access token” error message - WordPress.org
“Error: Your access token has expired. Please request a new one.” They say they are still able to donate but I don't understand...
Read more >
Error 999: Access token could not be decrypted.
Error 999: Access token could not be decrypted. The issue is being caused by the encryption that Instagram/Facebook requires in regards to access...
Read more >
Trouble with wordpress plugin - invalid access token and error
I'm attempting to connect the plugin to Zoom using JWT. ... Testing the API connection results in an “invalid access token” error. Which...
Read more >
Error fetching OAuth2 access token, message: '' - Stack Overflow
I'm using a very old version of Google Analytics Dashboard for WP (GADWP) Plugin, as the old version was great and the new...
Read more >
Uncaught Yoast\WP\SEO\Exceptions\OAuth\Tokens ... - GitHub
Djennez commented on Feb 28 edited · reinstall the plugin (completely remove all files and reinstall) · see if the error persists ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found