From aa0cb594999b0797963aeaacbc4f95d1186c863e Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Sun, 28 Jun 2015 20:34:03 +0300 Subject: [PATCH] bases update --- Content.py | 13 ++++++++++++- Core.py | 2 +- Player.py | 6 ++---- changelog.txt | 1 + 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Content.py b/Content.py index 40a2bd0..67ac5cd 100644 --- a/Content.py +++ b/Content.py @@ -173,7 +173,18 @@ class Content: encodedData = urllib.urlencode(data) else: encodedData = None - response = opener.open(url, encodedData) + try: + response = opener.open(url, encodedData) + except urllib2.HTTPError as e: + if e.code == 404: + print '[makeRequest]: Not Found! HTTP Error, e.code=' + str(e.code) + return + elif e.code in [503]: + print '[makeRequest]: Denied, HTTP Error, e.code=' + str(e.code) + return + else: + print '[makeRequest]: HTTP Error, e.code=' + str(e.code) + if response.info().get('Content-Encoding') == 'gzip': buf = StringIO(response.read()) f = gzip.GzipFile(fileobj=buf) diff --git a/Core.py b/Core.py index c3c88bf..928cfd6 100644 --- a/Core.py +++ b/Core.py @@ -62,7 +62,7 @@ class Core: ('«', '"'), ('»', '"'), ) - scrapperDB_ver = {'en':'1.1', 'ru':'1.2'} + scrapperDB_ver = {'en':'1.1', 'ru':'1.3'} print 'SYS ARGV: ' + str(sys.argv) diff --git a/Player.py b/Player.py index 5dea7e8..ac8a1b6 100644 --- a/Player.py +++ b/Player.py @@ -197,10 +197,8 @@ class TorrentPlayer(xbmc.Player): # mp4 fix label = os.path.basename(self.torrent.getFilePath(self.contentId)) isMP4 = False - if '.' in label: - ext = label.split('.')[-1] - if ext.lower() == 'mp4': - isMP4 = True + if '.' in label and str(label.split('.')[-1]).lower() == 'mp4': + isMP4 = True # print 'setup_torrent: '+str((self.contentId, Offset, isMP4, label, ext)) self.torrent.continueSession(self.contentId, Offset=Offset, isMP4=isMP4) diff --git a/changelog.txt b/changelog.txt index a484e6a..e1ad808 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,7 @@ [B]Version 2.2.9[/B] [+] .torrent Проигрыватель: Теперь .torrent не теряется при обновлении окна Kodi [+] Проигрыватель: Улучшенная настройка сессии из cherrytorrent +[+] Списки Медиа: Обновление баз на русском [B]Version 2.2.8[/B] [+] Добавлен Украинский язык (by kharts)