Question

Well ,I'm working on a bittorent client and I'm trying to generate thumbnails of video files by downloading a specific piece and extracting an image from it , yet I haven't been able to figure out a way to do so. Thanks

Was it helpful?

Solution

I take you you mean to download specific pieces of a torrent.

First, you probably want to map the beginning of a file to a range of pieces. You can do that with the torrent_info::map_file().

Then you can select which pieces to download by torrent_handle::prioritize_pieces(). Setting the priority of a piece to 0, means not to download it.

see libtorrent documentation

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top