Downloading a .torrent file from a specified source?
master255 opened this issue · comments
@arvidn I have integrated file downloading with Libp2p via url_seed. To fully work through Libp2p I still need to download a .torrent file. What is the best way to do it? Should I download the .torrent file via url_seed too?
Right now no http requests are received while there is no .torrent file.
Okay. I found it can be done this way:
final torrent_info torrentInfo = new torrent_info("path_to_torrent.torrent", errorCode);
downloadedTorrentHandle.swig().set_metadata(new create_torrent(torrentInfo).generate().get("info").bencode());
Another way:
Vectors.byte_vector2bytes(foundedHandle.write_resume_data(torrent_handle.save_info_dict).get("info").bencode())