Giter VIP home page Giter VIP logo

Comments (9)

ldsz avatar ldsz commented on August 15, 2024

Hi,
I'm running some tests but cheroot can be upgraded to the last version.
It's not the same for Cherrypy, as I remember some functions were removed or changed.

from plugin.audio.spotify.

Elkropac avatar Elkropac commented on August 15, 2024

So, it worked? I will try this updated version

from plugin.audio.spotify.

ldsz avatar ldsz commented on August 15, 2024

I have an issue with spotify connect, the first song is ok but the next one is not playing.
Local playback is ok for me.

from plugin.audio.spotify.

Elkropac avatar Elkropac commented on August 15, 2024

I have this in logs

2021-04-27 12:11:51.639 T:1086    ERROR <general>: [27/Apr/2021:12:11:51] HTTP
                                                   Traceback (most recent call last):
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/cherrypy/_cprequest.py", line 638, in respond
                                                       self._do_respond(path_info)
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/cherrypy/_cprequest.py", line 697, in _do_respond
                                                       response.body = self.handler()
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/cherrypy/lib/encoding.py", line 219, in __call__
                                                       self.body = self.oldhandler(*args, **kwargs)
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/cherrypy/_cpdispatch.py", line 54, in __call__
                                                       return self.callable(*self.args, **self.kwargs)
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/httpproxy.py", line 204, in nexttrack
                                                       return self.silence(20)
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/httpproxy.py", line 199, in silence
                                                       return cherrypy.lib.static.serve_fileobj(output_buffer.read(), content_type="audio/wav", name="%s.wav" % duration, debug=True)
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/cherrypy/lib/static.py", line 184, in serve_fileobj
                                                       return _serve_fileobj(fileobj, content_type, content_length, debug=debug)
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/cherrypy/lib/static.py", line 195, in _serve_fileobj
                                                       r = httputil.get_ranges(request.headers.get('Range'), content_length)
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/cherrypy/lib/httputil.py", line 91, in get_ranges
                                                       stop = content_length - 1
                                                   TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

When i changed line 199 in httpproxy.py to

return cherrypy.lib.static.serve_fileobj(output_buffer.read(), content_type="audio/wav", name="20.wav", debug=True)

I don't know python, so i just removed the formated print :) I guess, this problem will be on more places.

This error goes away. It still behaves strangely, it drops connection on every track change

from plugin.audio.spotify.

ldsz avatar ldsz commented on August 15, 2024

You have a NoneType for content_length because the file is empty or doesn't exist. I have the same.
The code is ok but I'm missing the log about the file not requested or downloaded.

The first error is :

2021-04-26 20:59:02.556 T:4644 ERROR : [26/Apr/2021:20:59:02] TOOLS.STATIC os has no fstat attribute
2021-04-26 20:59:02.556 T:4644 ERROR : [26/Apr/2021:20:59:02] TOOLS.STATIC Content-Type: 'audio/wav'
2021-04-26 20:59:02.556 T:4644 ERROR : [26/Apr/2021:20:59:02] TOOLS.STATIC Content-Disposition: None

from plugin.audio.spotify.

Elkropac avatar Elkropac commented on August 15, 2024

Have you found out something?

Everytime i try to seek in song or to skip to next song (using spotify connect), i get this in log

2021-04-29 23:51:11.057 T:3055    ERROR <general>: [29/Apr/2021:23:51:11] NATIVE_ADAPTER Traceback (most recent call last):
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/cherrypy/_cpnative_server.py", line 89, in respond
                                                       self.send_response(
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/cherrypy/_cpnative_server.py", line 117, in send_response
                                                       req.write(seg)
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/cheroot/server.py", line 1133, in write
                                                       self.conn.wfile.write(chunk)
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/cheroot/makefile.py", line 438, in write
                                                       res = super().write(val, *args, **kwargs)
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/cheroot/makefile.py", line 36, in write
                                                       self._flush_unlocked()
                                                     File "/home/prehravac/.kodi/addons/plugin.audio.spotify/resources/lib/cheroot/makefile.py", line 45, in _flush_unlocked
                                                       n = self.raw.write(bytes(self._write_buf))
                                                     File "/usr/lib/python3.9/socket.py", line 722, in write
                                                       return self._sock.send(b)
                                                   ConnectionResetError: [Errno 104] Connection reset by peer

I cannot figure out, which connection is reset. (I think it is download of wav file in proxy)

For a while, i thought, there is problem of 127.0.0.1 vs ::1 vs localhost connection,
because i got this on wireshark
image
in roughtly the same time as the error in log.

But even after trying to let the http proxy listen to all ip addresses (suboptimal - opens it to network) , i still get connectionresets in log

from plugin.audio.spotify.

ldsz avatar ldsz commented on August 15, 2024

I'm not sure to found a solution for now. I commented cherrypy.expose to have a simple solution :

  • Local playback is working
  • If you want to use spotify connect, you have to select "Spotify Connect : kodi" from the playback device menu first

With that modification I can update cheroot and cherrypy to the last version.

from plugin.audio.spotify.

Elkropac avatar Elkropac commented on August 15, 2024

Ok, thanks. I will try to debug more, maybe with strace. Can you show me picture of your sound selection, i think, i don't see your options there (i use pulseaudio to be able to send in another sounds/music from bluetooth and home assistant)

from plugin.audio.spotify.

Elkropac avatar Elkropac commented on August 15, 2024

It works now, strange. Today, I tested it with my wifes phone and it connects and changes tracks without problem. I have kodi plugin logged in on her account, but until today, i was testing spotify connect with my phone (and my account). There seems to be problem, when re-login to another account is involved.

from plugin.audio.spotify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.