se-bastiaan / TorrentStream-Android

A torrent streamer library for Android based on libtorrent4j
Other
343 stars 108 forks source link

Not all files from a torrent are loaded #43

Closed LazyDoge closed 6 years ago

LazyDoge commented 6 years ago

Hello, i try to use TorrentStream to load a multi file torrent. Progress get 100 (some times it does not, and stop at 98 or 99 % of progress, and i can't get 100% event, but is not main problem), but where are about 2 - 4 files ( most often its 3 files) in directory, and torrent info (on torrent traker site) says, that it must be 15 or more.

TorrentOptions torrentOptions = new TorrentOptions.Builder()
                                            .saveLocation(dir)
                                            .removeFilesAfterStop(true)
                                            .build();

                                    TorrentStream torrentStream = TorrentStream.init(torrentOptions);
                                    torrentStream.addListener(new TorrentListener() {....}
                                    torrentStream.startStream(torrentUrl);` 

I try this on my Nexus 5.

If u need more information, please ask..

se-bastiaan commented 6 years ago

That is because it is not supposed to download multiple files. Checkout the explanation here: https://github.com/TorrentStream/TorrentStream-Android/wiki/FAQ#how-does-it-work

If you just want to download a torrent you should use jlibtorrent directly.

LazyDoge commented 6 years ago

Thank you for the fast answer. Can u help me just a little more?
How do u think, is this code will be enought to download a torrent https://github.com/frostwire/frostwire-jlibtorrent/blob/master/src/test/java/com/frostwire/jlibtorrent/demo/DownloadTorrent.java , or there are much more work to handle, to get torrent get loaded. Thanks again, and sorry for interraption

se-bastiaan commented 6 years ago

It'll probably work, looks like a valid sample. Try it out, explore the public API. You should be able to get it working using their samples.