Fix artwork download.
authorstephendenham <stephendenham@2dec19e3-eb1d-4749-8193-008c8bba0994>
Sun, 29 Jun 2014 11:52:26 +0000 (11:52 +0000)
committerstephendenham <stephendenham@2dec19e3-eb1d-4749-8193-008c8bba0994>
Sun, 29 Jun 2014 11:52:26 +0000 (11:52 +0000)
git-svn-id: svn://svn.code.sf.net/p/xbmc-groove/code@100 2dec19e3-eb1d-4749-8193-008c8bba0994

addon.xml
changelog.txt
default.py

index 40502e8..ab0e3e2 100644 (file)
--- a/addon.xml
+++ b/addon.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.audio.groove" name="Grooveshark XBMC"
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.audio.groove" name="Grooveshark XBMC"
-       version="2.0.10" provider-name="Stephen Denham">
+       version="2.0.11" provider-name="Stephen Denham">
        <requires>
                <import addon="xbmc.python" version="2.1.0" />
                <import addon="script.module.simplejson"/>
        <requires>
                <import addon="xbmc.python" version="2.1.0" />
                <import addon="script.module.simplejson"/>
index 5dcfffe..d6a337b 100644 (file)
@@ -1,3 +1,7 @@
+2.11.0
+
+Fix artwork download.
+
 2.10.0
 
 Fix sessions bug.
 2.10.0
 
 Fix sessions bug.
index 75cc6b0..7528a13 100644 (file)
@@ -16,7 +16,7 @@
 #    along with xbmc-groove.  If not, see <http://www.gnu.org/licenses/>.
 
 
 #    along with xbmc-groove.  If not, see <http://www.gnu.org/licenses/>.
 
 
-import urllib, sys, os, shutil, re, pickle, time, traceback, xbmcaddon, xbmcplugin, xbmcgui, xbmc
+import urllib, urllib2, sys, os, shutil, re, pickle, time, traceback, xbmcaddon, xbmcplugin, xbmcgui, xbmc
 
 __addon__     = xbmcaddon.Addon('plugin.audio.groove')
 __addonname__ = __addon__.getAddonInfo('name')
 
 __addon__     = xbmcaddon.Addon('plugin.audio.groove')
 __addonname__ = __addon__.getAddonInfo('name')
@@ -728,8 +728,12 @@ class Grooveshark:
             localThumb = os.path.join(xbmc.translatePath(os.path.join(thumbDir, str(songid)))) + '.tbn'
             try:
                 if os.path.isfile(localThumb) == False:
             localThumb = os.path.join(xbmc.translatePath(os.path.join(thumbDir, str(songid)))) + '.tbn'
             try:
                 if os.path.isfile(localThumb) == False:
-                    loc = urllib.URLopener()
-                    loc.retrieve(url, localThumb)
+                    headers = { 'User-Agent' : 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/32.0.1700.102 Chrome/32.0.1700.102 Safari/537.36' }
+                    req = urllib2.Request(url, None, headers)
+                    loc = urllib2.urlopen(req)
+                    output = open(localThumb,'wb')
+                    output.write(loc.read())
+                    output.close()
             except:
                 shutil.copy2(thumbDef, localThumb)
             return os.path.join(os.path.join(thumbDir, str(songid))) + '.tbn'
             except:
                 shutil.copy2(thumbDef, localThumb)
             return os.path.join(os.path.join(thumbDir, str(songid))) + '.tbn'