Ejemplo n.º 1
0
    def __init__(self):
        mc.ShowDialogWait()
        self.useCoverArt = True
        self.player = mc.GetPlayer()
        self.defaultCoverArt = 'default-cover.png'
        self.xbmcPlaylist = mc.PlayList(mc.PlayList.PLAYLIST_MUSIC)
        self.gs = GrooveAPI(enableDebug=__debugging__,
                            cwd=__cwd__,
                            clientUuid=None,
                            clientVersion=None)
        username = __settings__.GetValue("username")
        password = __settings__.GetValue("password")
        self.gs.startSession(username, password)
        self.gs.setRemoveDuplicates(True)
        self._search = None

        self.start()
        mc.HideDialogWait()
Ejemplo n.º 2
0
__debugging__ = False
__parameters__ = mc.GetApp().GetLaunchedScriptParameters()
sys.path.append(os.path.join(__cwd__, 'libs'))


print 'GrooveShark: play script started'

org_url = ''
for i in sys.argv:
    org_url += str(i).replace('.py','?')
for var in __parameters__.keys():
    vars()[var] = __parameters__[var]

from GrooveAPI import *
try:
    gs = GrooveAPI(enableDebug = __debugging__, cwd = __cwd__,clientUuid = None, clientVersion = None)
    gs.startSession('','')

    if (playSong != None):
        print 'GrooveShark: Song ID: ' + str(playSong)
        url = gs.getStreamURL(str(playSong))
        if url != "":
            listItem = mc.ListItem(mc.ListItem.MEDIA_AUDIO_MUSIC)
            listItem.SetPath(str(url))
            listItem.SetProperty('info', str(org_url))
            listItem.SetContentType('audio/mpeg')
            listItem.SetTitle(songName)
            listItem.SetThumbnail(image)
            listItem.SetIcon(image)
            listItem.SetAlbum(albumName)
            listItem.SetArtist(artistName)