ldsz / plugin.audio.spotify

Unofficial spotify plugin for Kodi 19
GNU General Public License v3.0
47 stars 16 forks source link

Track Playback not Starting - Changing Code in httpproxy.py:send_audio_stream Fixes It #19

Open glk1001 opened 3 years ago

glk1001 commented 3 years ago

Hi,

I was having a 'Transferred a partial file' error with the plugin in master. Everything else was working fine. If I disable the first part of the if in 'resources/lib/httpproxy.py':

def send_audio_stream(self, track_id, filesize, wave_header, range_l):
    '''chunked transfer of audio data from spotty binary'''
    if False and self.spotty_bin != None and \
       self.spotty_trackid == track_id and \
       self.spotty_range_l == range_l:
        # leave the existing spotty running and don't start a new one.
        log_msg("WHOOPS!!! Running spotty still handling same request - leave it alone.", \
                xbmc.LOGERROR)
        return
    elif self.spotty_bin != None:

I can play tracks OK. Not sure what this means. I'm using Kodi 19.1 on Ubuntu 20.04.2. Without the hack above I get this in the kodi log:


2021-06-10 19:44:12.026 T:5922 INFO : plugin.audio.spotify --> b'!! Full File. Size : 59094044 ' 2021-06-10 19:44:12.028 T:5922 INFO : plugin.audio.spotify --> b'start transfer for track 1i5lXpzjo8qBAVRvEoBl7Z - range: 0' 2021-06-10 19:44:12.040 T:5922 INFO : plugin.audio.spotify --> b'Infos : Track : 1i5lXpzjo8qBAVRvEoBl7Z' 2021-06-10 19:44:13.807 T:5921 INFO : plugin.audio.spotify --> b'!! Full File. Size : 59094044 ' 2021-06-10 19:44:13.808 T:5921 INFO : plugin.audio.spotify --> b'WHOOPS!!! Running spotty still handling same request - leave it alone.' 2021-06-10 19:44:23.895 T:5893 ERROR : CCurlFile::FillBuffer - Failed: Transferred a partial file(18) 2021-06-10 19:44:23.895 T:5893 ERROR : Open - Error, could not open file http://localhost:52308/track/1i5lXpzjo8qBAVRvEoBl7Z/335.335 2021-06-10 19:44:23.895 T:5893 ERROR : Init: Error creating demuxer 2021-06-10 19:44:23.895 T:5893 ERROR : CAudioDecoder: Unable to Init Codec while loading file http://localhost:52308/track/1i5lXpzjo8qBAVRvEoBl7Z/335.335

thelightning87 commented 3 years ago

Edit: I see you put a False there.

Can confirm it now works.

Eddy226 commented 3 years ago

Thanks it works for me too

StevePirateX commented 2 years ago

Worked for me as well