I’ve just started using jlibtorrent, does it have any way to download specific files?

Partial Downloading

Yes, we call this “Partial Downloading”.

With a TorrentHandle object you want to play with methods like

filePriority(int index, Priority priority)

where the index represents the position of the file you want to download (or not) in the list of files described by the torrent.

You can also use prioritizeFiles(Priority[] priorities) to update the priorities, and you can find what the priorities are with Priority[] filePriorities()

A (Downloading) Priority is an enum whose possible values are
IGNORE (Don’t download this file),
NORMAL (Download this file depending on availability)

and then you have priorities that are considered higher than NORMAL,
they start at TWO all the way to SEVEN.

You can use the other priorities
different than NORMAL if you want certain files to be downloaded before others (network conditions allowing)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s