From fc14f8e2608e0f54f2666ea6129ed931b26b5bb1 Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Tue, 29 Mar 2016 18:57:54 +0300 Subject: [PATCH] fixes --- Anteoloader.py | 2 +- Inposloader.py | 2 +- SearcherABC.py | 12 +++--------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Anteoloader.py b/Anteoloader.py index 77bb932..4c26133 100644 --- a/Anteoloader.py +++ b/Anteoloader.py @@ -245,7 +245,7 @@ class AnteoLoader: self.torrentFile = torrent.torrentFile except: self.torrentFile = magnet - log('[AnteoLoader][magnetToTorrent]: self.torrentFile '+str(self.torrentFile)) + log('[AnteoLoader][magnetToTorrent]: self.torrentFile '+ensure_str(self.torrentFile)) class AnteoPlayer(xbmc.Player): __plugin__ = sys.modules["__main__"].__plugin__ diff --git a/Inposloader.py b/Inposloader.py index 8cd88a1..3be50f2 100644 --- a/Inposloader.py +++ b/Inposloader.py @@ -212,7 +212,7 @@ class InposLoader: self.torrentFile = torrent.torrentFile except: 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): __plugin__ = sys.modules["__main__"].__plugin__ diff --git a/SearcherABC.py b/SearcherABC.py index 2d0a4c9..35f1b3d 100644 --- a/SearcherABC.py +++ b/SearcherABC.py @@ -26,7 +26,7 @@ import tempfile import hashlib import os from StringIO import StringIO -import gzip +import zlib import socket import sys @@ -114,12 +114,6 @@ class SearcherABC: except: showMessage('AntiZapret', Localization.localize('Error')) 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: opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cookieJar)) opener.addheaders = headers @@ -142,8 +136,8 @@ class SearcherABC: #self.cookieJar.extract_cookies(response, urllib2) if response.info().get('Content-Encoding') == 'gzip': buf = StringIO(response.read()) - f = gzip.GzipFile(fileobj=buf) - response = f.read() + decomp = zlib.decompressobj(16 + zlib.MAX_WBITS) + response = decomp.decompress(buf.getvalue()) else: response = response.read() return response