2017-01-16, 14:36
2017-01-18, 23:30
Hello,
i was be able to fix this issue by changing the below function in the SubsceneUtilities.py file located under
Result
Thanks all.
i was be able to fix this issue by changing the below function in the SubsceneUtilities.py file located under
Code:
<kodi_userdata_folder>/addons/service.subtitles.subscene/resources/lib/
Code:
def geturl(url, cookies=None):
log(__name__, "Getting url: %s" % url)
try:
request = urllib2.Request(url)
request.add_header('Accept-encoding', 'gzip')
request.add_header('Content-Type', 'text/html; charset=utf-8')
if cookies:
request.add_header('Cookie', cookies)
request.add_header('User-Agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:41.0) Gecko/20100101 Firefox/41.0')
response = urllib2.urlopen(request)
encoding = response.headers.getparam('charset')
log(__name__, "request done")
if response.info().get('Content-Encoding') == 'gzip':
buf = StringIO(response.read())
f = gzip.GzipFile(fileobj=buf)
content = f.read().decode(encoding)
else:
content = response.read().decode(encoding)
log(__name__, "read done")
return_url = response.geturl()
log(__name__, "fetching done")
except:
log(__name__, "Failed to get url: %s" % url)
content = None
return_url = None
return content, return_url
Result
Thanks all.