From 72390ffb82e21d2e8e364a4a147a738258c044ba Mon Sep 17 00:00:00 2001 From: Gorka Olaizola Date: Sun, 18 Oct 2015 10:43:31 +0200 Subject: [PATCH 1/3] magnets got stuck until I added force_dht_announce I have tested millions of ways to make magnets work but it worked magically after adding force_dht_announce to the waiting bucle --- Libtorrent.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libtorrent.py b/Libtorrent.py index 42b8934..baa0f76 100644 --- a/Libtorrent.py +++ b/Libtorrent.py @@ -169,6 +169,9 @@ class Libtorrent: iterator = 0 while iterator < 100: xbmc.sleep(500) + + self.torrentHandle.force_dht_announce() + progressBar.update(iterator, Localization.localize('Please Wait'), Localization.localize('Magnet-link is converting')+'.' * (iterator % 4), ' ') iterator += 1 if progressBar.iscanceled(): From 1eb844d7e56e9270dd0ccda9a2ea110c06acfef2 Mon Sep 17 00:00:00 2001 From: Gorka Olaizola Date: Sun, 18 Oct 2015 10:47:38 +0200 Subject: [PATCH 2/3] Add number of dht peers to debug info --- Libtorrent.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Libtorrent.py b/Libtorrent.py index baa0f76..fdb8aba 100644 --- a/Libtorrent.py +++ b/Libtorrent.py @@ -530,7 +530,13 @@ class Libtorrent: result=result+'Trackers: verified %d/%d, fails=%d' %(verified_sum, len(trackers)-1, fails_sum) if info=='dht_state': is_dht_running='ON' if self.session.is_dht_running() else 'OFF' - nodes=0 + + dht_state = self.session.dht_state() + if 'nodes' in dht_state: + nodes = len(dht_state['nodes']) + else: + nodes=0 + result='DHT: %s (%d)' % (is_dht_running, nodes) return result From b0cd756f512cb5685255da5c2196e7cf996f3ff7 Mon Sep 17 00:00:00 2001 From: Gorka Olaizola Date: Sun, 18 Oct 2015 10:56:47 +0200 Subject: [PATCH 3/3] bitcomet.com dht router host does not exists anymore --- Libtorrent.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Libtorrent.py b/Libtorrent.py index fdb8aba..30c702b 100644 --- a/Libtorrent.py +++ b/Libtorrent.py @@ -350,7 +350,6 @@ class Libtorrent: #self.session.set_alert_mask(self.lt.alert.category_t.all_categories) self.session.add_dht_router("router.bittorrent.com", 6881) self.session.add_dht_router("router.utorrent.com", 6881) - self.session.add_dht_router("router.bitcomet.com", 6881) self.session.start_dht() self.session.start_lsd() self.session.start_upnp()