Merge pull request #36 from Palatosino/master

Use zlib instead of gzip
pull/1/head
DiMartinoXBMC 2016-03-12 01:08:18 +03:00
commit e6fb0434e9
2 changed files with 1307 additions and 1307 deletions

View File

@ -22,7 +22,7 @@ import urllib2
import hashlib import hashlib
import re import re
from StringIO import StringIO from StringIO import StringIO
import gzip import zlib
import xbmc import xbmc
import xbmcgui import xbmcgui
@ -205,8 +205,8 @@ class AnteoLoader:
result = urllib2.urlopen(request) result = urllib2.urlopen(request)
if result.info().get('Content-Encoding') == 'gzip': if result.info().get('Content-Encoding') == 'gzip':
buf = StringIO(result.read()) buf = StringIO(result.read())
f = gzip.GzipFile(fileobj=buf) decomp = zlib.decompressobj(16 + zlib.MAX_WBITS)
content = f.read() content = decomp.decompress(buf.getvalue())
else: else:
content = result.read() content = result.read()

View File

@ -24,7 +24,7 @@ import urllib2
import hashlib import hashlib
import re import re
from StringIO import StringIO from StringIO import StringIO
import gzip import zlib
import sys import sys
import xbmc import xbmc
@ -108,8 +108,8 @@ class Libtorrent:
result = urllib2.urlopen(request) result = urllib2.urlopen(request)
if result.info().get('Content-Encoding') == 'gzip': if result.info().get('Content-Encoding') == 'gzip':
buf = StringIO(result.read()) buf = StringIO(result.read())
f = gzip.GzipFile(fileobj=buf) decomp = zlib.decompressobj(16 + zlib.MAX_WBITS)
content = f.read() content = decomp.decompress(buf.getvalue())
else: else:
content = result.read() content = result.read()
@ -428,7 +428,7 @@ class Libtorrent:
#'storage_mode': self.lt.storage_mode_t(1), #'storage_mode': self.lt.storage_mode_t(1),
'paused': False, 'paused': False,
#'auto_managed': False, #'auto_managed': False,
'duplicate_is_error': False #'duplicate_is_error': True
} }
if self.save_resume_data: if self.save_resume_data:
log('loading resume data') log('loading resume data')