mktorrent
creates BitTorrent metainfo files
TLDR
Create torrent from file
SYNOPSIS
mktorrent [-a tracker] [-p] [-l piecelength] [-o output.torrent] [options] path_
DESCRIPTION
mktorrent creates BitTorrent metainfo (.torrent) files. It hashes the content and packages file information with tracker details.
The tool calculates piece hashes for file verification. Piece length affects swarm efficiency - larger pieces reduce overhead but delay initial sharing. Auto-selection usually works well.
Multiple trackers provide redundancy. When one tracker is down, clients try others. Private torrents disable DHT and peer exchange, requiring tracker-only operation.
Web seeds provide HTTP fallback when peers are unavailable. They're useful for initial seeding or low-popularity torrents.
The source tag helps private trackers identify torrents from their site. It's embedded in the info dictionary, becoming part of the info hash.
Creation is fast for small files but may take time for large datasets due to hashing requirements.
PARAMETERS
-a URL
Tracker announce URL.-o FILE
Output torrent file.-p
Private torrent (no DHT/PEX).-l N
Piece length as power of 2 (default auto).-c TEXT
Comment.-n NAME
Name in torrent (default: path basename).-w URL
Web seed URL.-s TEXT
Source tag for private trackers.-v
Verbose output.-t THREADS
Number of threads for hashing.-d
Don't write creation date.
CAVEATS
Changing any content after creation invalidates the torrent. Private tracker torrents not interoperable with public. Large piece sizes delay initial piece completion.
HISTORY
mktorrent was written as a lightweight, fast torrent creator. It provides command-line access to torrent creation without requiring a full BitTorrent client.
SEE ALSO
transmission-create(1), rtorrent(1), aria2c(1)
