- item.setPath(url)
- if self.debug:
- xbmc.log("Grooveshark playing: " + url)
- xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]), succeeded=True, listitem=item)
- # Wait for play then start time
- seconds = 0
- while seconds < STREAM_MARKING_TIME:
- try:
- if player.isPlayingAudio() == True:
- if playTimer != None:
- playTimer.cancel()
- songMarkTime = 0
- duration = int(item.getProperty('duration'))
- playTimer = PlayTimer(1, markSong, duration, [songid, duration])
- playTimer.start()
- break
- except: pass
- time.sleep(1)
- seconds = seconds + 1
+ key = stream['StreamKey']
+ server = stream['StreamServerID']
+ duration = self._setDuration(stream['uSecs'])
+ if url != '':
+ item.setPath(url)
+ xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]), succeeded=True, listitem=item)
+ if __debugging__ :
+ xbmc.log("Grooveshark playing: " + url)
+ # Wait for play then start timer
+ seconds = 0
+ while seconds < STREAM_TIMEOUT:
+ try:
+ if player.isPlayingAudio() == True:
+ if playTimer != None:
+ playTimer.cancel()
+ songMarkTime = 0
+ playTimer = PlayTimer(1, markSong, duration, [songid, duration, key, server])
+ playTimer.start()
+ break
+ except: pass
+ time.sleep(1)
+ seconds = seconds + 1
+ else:
+ xbmc.log("No song URL")