hightorrent

Crates.iohightorrent
lib.rshightorrent
version0.2.0
sourcesrc
created_at2022-12-22 17:02:45.117731
updated_at2024-09-02 17:35:00.833849
descriptionHigh-level torrent library which supports Bittorrent v1, v2 and hybrid torrents
homepage
repository
max_upload_size
id744025
size227,364
(angrynode)

documentation

https://docs.rs/hightorrent

README

HighTorrent

HighTorrent is a library which contains high-level data structures and functions to study and interact with Bittorrent v1 and v2 torrents. HighTorrent does not aim to be featureful, but rather to be super easy to use and interoperate with more advanced torrent software, and completely impossible to misuse.

Note that HighTorrent is not a networked library. It will not provide any utilities for querying the DHT and/or downloading torrents. HighTorrent is much lower in the stack.

We mostly provide utilities to extract name and hash from torrents/magnets, using the MagnetLink and TorrentFile structures, but could provide more advanced utilities in the future (PRs welcome).

Additionally, we provide the Torrent struct and the IntoTorrent trait representing fully-loaded torrents. These helpers are intended to be used by more diverse torrenting libraries to provide interoperability out-of-the-box.

Finally, the SingleTarget and MultiTarget structures represent one or more torrents you wish to interact with. The contained stringy value is ambiguous, and can represent either a precise InfoHash or a libtorrent-compatible TorrentID (truncated hash).

Related projects

  • intermodal: CLI program for managing torrents, but does not expose a library crate

Do you know other related Rust projects? Please let us know.

This library was developed as part of the TorrentManager project, because there was no high-level library to read magnet links and torrent files that would support Bittorrent v2 torrents. New features will be added as they are required by the larger project, but suggestions are welcome if this library can benefit other people and projects as well.

Possible improvements for v1

  • hand-implement errors to remove snafu dependency
  • provide one-off methods to read name/hash from torrent/magnet
  • store hashes as integers (not strings) for optimization
  • make Tracker differentiate HTTP/HTTPS trackers
  • implement MultiTarget filtering, including boolean logic (AND/OR/XOR)
  • provide more information for TorrentFile (eg. files list)
  • consider replacing Torrent with a trait

License

GNU AGPL v3

Commit count: 0

cargo fmt