I was searching how to pass an argument in torrent_info() function during the use of magnet links in libtorrent. Especially my target is to analyze peers and pieces. With the us
Adding a magnet link gives you a torrent handle, from which you will be able to get torrent infos (once the metadata has been fetched - it will throw otherwise).
Unlike torrent files, where the metadata is already here, magnet links require the metadata to be retrieved from the network as a starter, and that can take some time.
I'm more used to the C++ library, but well - to have it demo at the dirtiest, you can do something in the line of:
handle = lt.add_magnet_uri(ses, link, params)
while (not handle.has_metadata()):
time.sleep(.1)
info = handle.get_torrent_info()
... then, you can read all about it here ;) http://www.rasterbar.com/products/libtorrent/manual.html#torrent-info