-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the torrentlib wiki!
Python helpers for BitTorrent tracker queries, peer communication, and metadata inspection.
torrentlib is not a full BitTorrent client. It can:
- load
.torrentmetadata - announce to HTTP and UDP trackers
- collect IPv4 and IPv6 peer lists
- connect to peers and download metadata
- process peer exchange (
ut_pex) messages - edit and rebuild
.torrentfiles - parse magnet links, including tracker and peer hints
It does not manage piece downloads/uploads for complete content transfer.
pip install torrentlibPython 3.10 through 3.14 are supported.
To begin using the library, start by creating a Torrent object from metainfo, an info hash, or a magnet link, and then querying trackers for peers. If you start without full metainfo, you will also need to contact a peer to download the metadata.
Beyond the core torrent lifecycle, the library provides built-in interfaces to check tracker health and to modify, retrieve information from, or rebuild .torrent files. For implementation details and troubleshooting, you can explore the error handling guide and comprehensive usage examples.
The project is distributed using MIT. See LICENSE.