pull/11/head
DiMartinoXBMC 2016-03-29 18:57:54 +03:00
parent aab077f4a7
commit fc14f8e260
3 changed files with 5 additions and 11 deletions

View File

@ -245,7 +245,7 @@ class AnteoLoader:
self.torrentFile = torrent.torrentFile self.torrentFile = torrent.torrentFile
except: except:
self.torrentFile = magnet self.torrentFile = magnet
log('[AnteoLoader][magnetToTorrent]: self.torrentFile '+str(self.torrentFile)) log('[AnteoLoader][magnetToTorrent]: self.torrentFile '+ensure_str(self.torrentFile))
class AnteoPlayer(xbmc.Player): class AnteoPlayer(xbmc.Player):
__plugin__ = sys.modules["__main__"].__plugin__ __plugin__ = sys.modules["__main__"].__plugin__

View File

@ -212,7 +212,7 @@ class InposLoader:
self.torrentFile = torrent.torrentFile self.torrentFile = torrent.torrentFile
except: except:
self.torrentFile = magnet self.torrentFile = magnet
log('['+author+'Loader][magnetToTorrent]: self.torrentFile '+str(self.torrentFile)) log('['+author+'Loader][magnetToTorrent]: self.torrentFile '+ensure_str((self.torrentFile)))
class InposPlayer(xbmc.Player): class InposPlayer(xbmc.Player):
__plugin__ = sys.modules["__main__"].__plugin__ __plugin__ = sys.modules["__main__"].__plugin__

View File

@ -26,7 +26,7 @@ import tempfile
import hashlib import hashlib
import os import os
from StringIO import StringIO from StringIO import StringIO
import gzip import zlib
import socket import socket
import sys import sys
@ -114,12 +114,6 @@ class SearcherABC:
except: except:
showMessage('AntiZapret', Localization.localize('Error')) showMessage('AntiZapret', Localization.localize('Error'))
self.debug('[antizapret]: OFF!') self.debug('[antizapret]: OFF!')
#elif self.proxy == 2:
# from resources.proxy import immunicity
# opener = urllib2.build_opener(immunicity.ImmunicityProxyHandler(), urllib2.HTTPCookieProcessor(self.cookieJar))
# config = immunicity.config()
# self.debug('[immunicity]: '+str(config["domains"]))
# self.debug('[immunicity]: '+str(config["server"]))
if not opener: if not opener:
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cookieJar)) opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cookieJar))
opener.addheaders = headers opener.addheaders = headers
@ -142,8 +136,8 @@ class SearcherABC:
#self.cookieJar.extract_cookies(response, urllib2) #self.cookieJar.extract_cookies(response, urllib2)
if response.info().get('Content-Encoding') == 'gzip': if response.info().get('Content-Encoding') == 'gzip':
buf = StringIO(response.read()) buf = StringIO(response.read())
f = gzip.GzipFile(fileobj=buf) decomp = zlib.decompressobj(16 + zlib.MAX_WBITS)
response = f.read() response = decomp.decompress(buf.getvalue())
else: else:
response = response.read() response = response.read()
return response return response