forked from premiere/premiere-libtorrent
fix python binding for parse_magnet_uri (#1838)
fix python binding for parse_magnet_uri
This commit is contained in:
parent
4d397f5ebf
commit
2e367ea53b
|
@ -1,3 +1,4 @@
|
||||||
|
* fix python binding for parse_magnet_uri
|
||||||
* fix minor robustness issue in DHT bootstrap logic
|
* fix minor robustness issue in DHT bootstrap logic
|
||||||
* fix issue where torrent_status::num_seeds could be negative
|
* fix issue where torrent_status::num_seeds could be negative
|
||||||
* document deprecation of dynamic loading/unloading of torrents
|
* document deprecation of dynamic loading/unloading of torrents
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace {
|
||||||
, end(p.dht_nodes.end()); i != end; ++i)
|
, end(p.dht_nodes.end()); i != end; ++i)
|
||||||
tracker_list.append(boost::python::make_tuple(i->first, i->second));
|
tracker_list.append(boost::python::make_tuple(i->first, i->second));
|
||||||
ret["dht_nodes"] = nodes_list;
|
ret["dht_nodes"] = nodes_list;
|
||||||
ret["info_hash"] = p.info_hash;
|
ret["info_hash"] = p.info_hash.to_string();
|
||||||
ret["name"] = p.name;
|
ret["name"] = p.name;
|
||||||
ret["save_path"] = p.save_path;
|
ret["save_path"] = p.save_path;
|
||||||
ret["storage_mode"] = p.storage_mode;
|
ret["storage_mode"] = p.storage_mode;
|
||||||
|
|
|
@ -256,6 +256,15 @@ class test_sha1hash(unittest.TestCase):
|
||||||
s = lt.sha1_hash(binascii.unhexlify(h))
|
s = lt.sha1_hash(binascii.unhexlify(h))
|
||||||
self.assertEqual(h, str(s))
|
self.assertEqual(h, str(s))
|
||||||
|
|
||||||
|
class test_magnet_link(unittest.TestCase):
|
||||||
|
|
||||||
|
def test_parse_magnet_uri(self):
|
||||||
|
ses = lt.session({})
|
||||||
|
magnet = 'magnet:?xt=urn:btih:C6EIF4CCYDBTIJVG3APAGM7M4NDONCTI'
|
||||||
|
p = lt.parse_magnet_uri(magnet)
|
||||||
|
p['save_path'] = '.'
|
||||||
|
h = ses.add_torrent(p)
|
||||||
|
self.assertEqual(str(h.info_hash()), '178882f042c0c33426a6d81e0333ece346e68a68')
|
||||||
|
|
||||||
class test_session(unittest.TestCase):
|
class test_session(unittest.TestCase):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue