frostwire / frostwire-jlibtorrent

A swig Java interface for libtorrent by the makers of FrostWire. Develop libtorrent based apps with the joy of coding in Java.
http://www.frostwire.com
MIT License
444 stars 137 forks source link

Select files to download from torrent #212

Closed Larsg310 closed 5 years ago

Larsg310 commented 5 years ago

I'm currently looking for a way to download a single file from a torrent containing multiple files.

For example, I have a torrent with an MKV file and a readme.txt file. I only want to download the MKV file, and not the readme.txt file, as I don't need it.

Is this possible?

proninyaroslav commented 5 years ago

You can ignore other files, just setting their priority as ignore:

torrentHandle.filePriority(fileIndex0, Priority.IGNORE);
torrentHandle.filePriority(fileIndex1, Priority.IGNORE);
...