![]() ![]() Torrent_info.orig_files() is also missing in python bindings, I'm not sure whether torrent_info.files() is sufficient. ![]() torrent file from a magnet uri when using python bindings. When I find some time I will report this missing api bug to libtorrent developers, as currently it is impossible to create a. It expects hash to be const char* but torrent_info.hash_for_piece(int) returns class big_number which has no api to convert it back to const char*. There is an error thrown on this line: t_hash(i, hash) So I tried it another way, but also encountered a brick wall that makes it impossible, here is the code: if handle.has_metadata():įor i in xrange(0, torinfo.num_pieces()):į.write(libtorrent.bencode(torfile.generate())) Seems like libtorrent python api is missing some of important c++ api that is required to create torrent from magnets, the example above won't work in python cause create_torrent python class does not accept torrent_info as parameter (c++ has it available). "handle" is from here: torrent_handle add_magnet_uri(session& ses, std::string const& uri add_torrent_params p) Īlso before creating torrent you have to make sure that metadata has been downloaded, do this by calling handle.has_metadata(). To this: torrent_info ti = handle.get_torrent_info() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |