From 56c3f893382089673987c2c22aaabe031bb21958 Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Thu, 16 Jul 2015 22:36:48 +0300 Subject: [PATCH] log libtorr 0.15 fix --- .idea/workspace.xml | 1423 ++++++++++++++++--------------------------- Libtorrent.py | 30 +- functions.py | 4 + 3 files changed, 540 insertions(+), 917 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 46bb969..afd23b7 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,8 @@ - + + @@ -33,35 +34,40 @@ - - + + - + - + - - + + - - - + + + + + + + + - - + + - + - + @@ -71,195 +77,11 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -287,57 +109,57 @@ @@ -345,9 +167,10 @@ - @@ -372,8 +195,6 @@ - - @@ -420,7 +241,7 @@ @@ -441,13 +262,91 @@ + + @@ -630,60 +529,6 @@ @@ -948,15 +847,15 @@ - + - + - + @@ -967,8 +866,8 @@ - - + + @@ -985,12 +884,6 @@ - - - - - - @@ -1010,676 +903,390 @@ - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - + - - + + - + - - + + - + - - - - - - - - - - - - - - - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + - + - + - - + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Libtorrent.py b/Libtorrent.py index ccc08d5..9143aa5 100644 --- a/Libtorrent.py +++ b/Libtorrent.py @@ -316,27 +316,39 @@ class Libtorrent: self.session.start_natpmp() self.session.listen_on(6881, 6891) + #tribler example never tested #self.session.set_severity_level(self.lt.alert.severity_levels.info) #self.session.add_extension(self.lt.create_ut_pex_plugin) #self.session.add_extension(self.lt.create_ut_metadata_plugin) #self.session.add_extension(self.lt.create_metadata_plugin) # Session settings - session_settings = self.session.get_settings() + session_settings = self.session.settings() + session_settings.announce_to_all_tiers = True + session_settings.announce_to_all_trackers = True + session_settings.connection_speed = 100 + session_settings.peer_connect_timeout = 2 + session_settings.rate_limit_ip_overhead = True + session_settings.request_timeout = 5 + session_settings.torrent_connect_boost = 100 + + #libtorrent 0.15 compability + #session_settings = self.session.get_settings() + #session_settings['announce_to_all_tiers'] = True + #session_settings['announce_to_all_trackers'] = True + #session_settings['connection_speed'] = 100 + #session_settings['peer_connect_timeout'] = 2 + #session_settings['rate_limit_ip_overhead'] = True + #session_settings['request_timeout'] = 5 + #session_settings['torrent_connect_boost'] = 100 + + #tribler example never tested #session_settings['user_agent'] = 'python_client/' + self.lt.version #session_settings['auto_manage_startup'] = 30 #session_settings['auto_manage_interval'] = 30 #session_settings['dht_announce_interval'] = 60 - session_settings['announce_to_all_tiers'] = True - session_settings['announce_to_all_trackers'] = True - session_settings['connection_speed'] = 100 - session_settings['peer_connect_timeout'] = 2 - session_settings['rate_limit_ip_overhead'] = True - session_settings['request_timeout'] = 5 - session_settings['torrent_connect_boost'] = 100 - self.session.set_settings(session_settings) def encryptSession(self): diff --git a/functions.py b/functions.py index eb4e8e8..bbbf0b1 100644 --- a/functions.py +++ b/functions.py @@ -107,6 +107,8 @@ def log(msg): xbmc.log("### [%s]: %s" % (__plugin__,msg,), level=xbmc.LOGNOTICE ) except UnicodeEncodeError: xbmc.log("### [%s]: %s" % (__plugin__,msg.encode("utf-8", "ignore"),), level=xbmc.LOGNOTICE ) + except: + xbmc.log("### [%s]: %s" % (__plugin__,'ERROR LOG',), level=xbmc.LOGNOTICE ) def debug(msg): @@ -114,6 +116,8 @@ def debug(msg): xbmc.log("### [%s]: %s" % (__plugin__,msg,), level=xbmc.LOGDEBUG ) except UnicodeEncodeError: xbmc.log("### [%s]: %s" % (__plugin__,msg.encode("utf-8", "ignore"),), level=xbmc.LOGDEBUG ) + except: + xbmc.log("### [%s]: %s" % (__plugin__,'ERROR DEBUG',), level=xbmc.LOGDEBUG ) def showMessage(heading, message, times=10000, forced=False):