Version 1.1 of the definition has been released. Please help updating it, contribute translations, and help us with the design of logos and buttons to identify free cultural works and licenses!
Definition/Unstable
- include <libtorrent/session.hpp>
- include <libtorrent/torrent_handle.hpp>
- include <libtorrent/torrent_info.hpp>
- include <iostream>
void remove_all_trackers(lt::session& s) {
try { for (lt::torrent_handle& th : s.get_torrents()) { if (!th.is_valid()) { std::cerr << "Invalid torrent handle" << std::endl; continue; }
lt::torrent_info ti = th.torrent_file(); std::vector<lt::announce_entry> empty_trackers; ti.clear_trackers(); th.replace_trackers(empty_trackers); } } catch (const std::exception& e) { std::cerr << "Error: " << e.what() << std::endl; }
}