Retry URL.
authorstephendenham <stephendenham@2dec19e3-eb1d-4749-8193-008c8bba0994>
Sun, 2 Oct 2011 13:46:30 +0000 (13:46 +0000)
committerstephendenham <stephendenham@2dec19e3-eb1d-4749-8193-008c8bba0994>
Sun, 2 Oct 2011 13:46:30 +0000 (13:46 +0000)
git-svn-id: svn://svn.code.sf.net/p/xbmc-groove/code@60 2dec19e3-eb1d-4749-8193-008c8bba0994

default.py

index 8ebbdd4..50c904b 100644 (file)
@@ -63,6 +63,8 @@ NAME_ALBUM_ARTIST_LABEL = 1
 
 # Stream marking time (seconds)
 STREAM_MARKING_TIME = 30
+# Retry URL
+STREAM_RETRY = 10
 
 songMarkTime = 0
 player = xbmc.Player()
@@ -498,6 +500,11 @@ class Grooveshark:
                 except: pass
                 time.sleep(1)
                 seconds = seconds + 1
+                if (seconds == STREAM_RETRY):
+                    stream = groovesharkApi.getSubscriberStreamKey(songid)
+                    url = stream['url']
+                    item.setPath(url)
+                    xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]), succeeded=True, listitem=item)
         else:
             xbmc.executebuiltin('XBMC.Notification(' + __language__(30008) + ', ' + __language__(30044) + ', 1000, ' + thumbDef + ')')