Discussion:
[libtorrent] Total number of pieces
Héctor Helenio
2016-12-14 13:11:27 UTC
Permalink
Hi, how to know how many pieces of a torrent with a magnet link

Already getting the metadata


Torrent_info const & ti = h.get_torrent_info ();
Int num_pieces = ti.num_pieces ()


The torrent_info statement when compiling it

Warning: 'const libtorrent :: torrent_info & libtorrent :: torrent_handle
:: get_torrent_info () const' is deprecated (declared at
/usr/local/include/libtorrent/torrent_handle.hpp:842)
[-Wdeprecated-declarations]
Torrent_info const & ti = h.get_torrent_info ();
^

What is the correct way to initialize ti?

Is there another way to do this?
Calum Lind
2016-12-14 14:51:49 UTC
Permalink
torrent_file() according to header:

https://github.com/arvidn/libtorrent/blob/RC_1_1/include/libtorrent/torrent_handle.hpp#L918
Post by Héctor Helenio
Hi, how to know how many pieces of a torrent with a magnet link
Already getting the metadata
Torrent_info const & ti = h.get_torrent_info ();
Int num_pieces = ti.num_pieces ()
The torrent_info statement when compiling it
Warning: 'const libtorrent :: torrent_info & libtorrent :: torrent_handle
:: get_torrent_info () const' is deprecated (declared at
/usr/local/include/libtorrent/torrent_handle.hpp:842)
[-Wdeprecated-declarations]
Torrent_info const & ti = h.get_torrent_info ();
^
What is the correct way to initialize ti?
Is there another way to do this?
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
Loading...