kodi-community-addons / plugin.audio.spotify

Unofficial spotify plugin for Kodi
GNU General Public License v3.0
298 stars 103 forks source link

playing stopped (while playing from smartphone on kodi using spotify connect) #99

Open adampelikan opened 6 years ago

adampelikan commented 6 years ago

Hello guys, please check this issue.

I play my music from android spotify app on my kodi using spotify connect. Sometimes (apx once per hour) the playing is just stopped. In android app I can right after select the kodi spotify connect device again and start playing.

If you need more info or I can assist somehow, let me know.

Btw. thanks for this awesome addon.

OS: Ubuntu 16.04 kodi: 17 krypton hardware: notebook amd64 addon version: current

kodi.log:

21:08:49.824 T:140528140834560 NOTICE: ['[SC] Scan skipped'] 21:10:37.714 T:140528746215168 ERROR: CCurlFile::FillBuffer - Failed: Transferred a partial file(18) 21:10:37.714 T:140528746215168 WARNING: CCurlFile::FillBuffer - Reconnect, (re)try 1 21:10:52.247 T:140528531416832 NOTICE: plugin.audio.spotify --> Logged in to Spotify - Username: adam.pelikan 21:10:55.043 T:140528531416832 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--

  • NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <class 'spotipy.client.SpotifyException'> Error Contents: http status: 404, code:-1 - https://api.spotify.com/v1/me/player/next: No active device found Traceback (most recent call last): File "/home/adam/.kodi/addons/plugin.audio.spotify/resources/lib/player_monitor.py", line 72, in onPlayBackStarted self.__sp.next_track() File "/home/adam/.kodi/addons/plugin.audio.spotify/resources/lib/spotipy/client.py", line 988, in next_track return self._post(self._append_device_id("me/player/next", device_id)) File "/home/adam/.kodi/addons/plugin.audio.spotify/resources/lib/spotipy/client.py", line 180, in _post return self._internal_call('POST', url, payload, kwargs) File "/home/adam/.kodi/addons/plugin.audio.spotify/resources/lib/spotipy/client.py", line 126, in _internal_call headers=r.headers) SpotifyException: http status: 404, code:-1 - https://api.spotify.com/v1/me/player/next: No active device found -->End of Python script error report<--
Kuchiru commented 6 years ago

I'm experiencing the same with spotify connect no matter from which device, reset the addon settings and cloned the repo again to no avail.

gismo2004 commented 6 years ago

It happens when a new token is set...

Lesproges commented 6 years ago

Same here. Kodi crash after several minute then reboot.

marcelveldt commented 6 years ago

yep, it's a race condition. Happens at the time that the token is expired and not yet auto refreshed. I'm a bit busy atm with our new house (almost done) but once I have a little spare time left I'll make the code more robust to handle this condition. Offcourse anyone with python experience can easliy fix it too and submit a PR

Lesproges commented 6 years ago

Ok fyi,

  1. fresh install of Kodi and addon on rpi 3,
  2. uninstall then reinstall spotify on the phone.
  3. No more stop playing and spotify connect working fine.
adampelikan commented 5 years ago

yep, it's a race condition. Happens at the time that the token is expired and not yet auto refreshed. I'm a bit busy atm with our new house (almost done) but once I have a little spare time left I'll make the code more robust to handle this condition. Offcourse anyone with python experience can easliy fix it too and submit a PR

Hi @marcelveldt would you be so kind and have a look at this issue? Or at least try to give me some advice where I can try to fix it (I have some basic python experience)?

A.