<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.audio.groove" name="Grooveshark XBMC"
- version="0.2.0" provider-name="Stephen Denham">
+ version="0.2.1" provider-name="Stephen Denham">
<requires>
<import addon="xbmc.python" version="1.0" />
</requires>
+0.2.1:
+
+Use song URL directly for playback. Much faster.
+
0.2.0:
Major changes to use new Grooveshark API.
def playSong(self, item):
songid = item.getProperty('songid')
song = groovesharkApi.getSongURLFromSongID(songid)
- if os.path.isfile(song):
+ if song != '':
item.setPath(song)
xbmc.log("Playing: " + song)
xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]), succeeded=True, listitem=item)
else:
- xbmc.executebuiltin('XBMC.Notification(Grooveshark XBMC, Cannot play song, 1000, ' + thumbDef + ')')
+ xbmc.executebuiltin('XBMC.Notification(Grooveshark XBMC, Unable to play song, 1000, ' + thumbDef + ')')
# Make a song directory item
def songItem(self, songid, name, album, artist, coverart):
<title>Grooveshark XBMC.</title>
<!-- (required) Major.minor.build -->
- <version>0.2.0</version>
+ <version>0.2.1</version>
<!--
(required) author name & email. at least one author name is required
"songID": songID}
self._callRemote("markSongDownloaded", params)
- # Download a song to a temporary file
+ # Get the song URL
def getSongURL(self, songID):
- filename = os.path.join(self.cacheDir, songID + SONG_SUFFIX)
- print "Caching song " + songID + " to " + filename
- if os.path.isfile(filename) == False:
- if self._getStreamDetails(songID) == True:
- postData = {"streamKey": self._lastStreamKey}
- postData = urllib.urlencode(postData)
- urllib.FancyURLopener().retrieve( "http://" + self._lastStreamServer + "/stream.php", filename, data=postData)
- self._markSongDownloaded(songID)
- else:
- return ''
- return filename
+ if self._getStreamDetails(songID) == True:
+ postData = {"streamKey": self._lastStreamKey}
+ postData = urllib.urlencode(postData)
+ return "http://" + self._lastStreamServer + "/stream.php?" + str(postData)
+ else:
+ return ''
# Main API
class GrooveAPI:
# Get the url to link to a song on Grooveshark
def getSongURLFromSongID(self, songID):
song = GrooveSong()
- return song.getSongURL(songID)
+ url = song.getSongURL(songID)
+ print "Got song URL " + url
+ return url
# Get the url to link to a song on Grooveshark
def getSongInfo(self, songID):