def getATVURL(url):
try:
opener = urllib2.build_opener()
Log('ATVURL --> url = ' + url)
hmac_key = binascii.unhexlify('f5b0a28b415e443810130a4bcb86e50d800508cc')
sig = hmac.new(hmac_key, url, hashlib.sha1)
androidsig = base64.encodestring(sig.digest()).replace('\n', '')
opener.addheaders = [('x-android-sign', androidsig)]
usock = opener.open(url)
response = usock.read()
usock.close()
except urllib2.URLError, e:
Log('Error reason: %s' % e, xbmc.LOGERROR)
return False
else:
return response
评论列表
文章目录