Clover (π) is a lightweight, fast, leech-only torrent client written in Go. It implements the core BitTorrent protocol to download torrents directly from the terminal. It handles everything from parsing .torrent files and discovering peers to managing concurrent piece downloads.
- Torrent parsing - Implements an encoder and decoder for parsing bencode encoded .torrent files.
- Dual peer discovery - Finds peers via both UDP trackers and the DHT network, merging them into a single stream.
- Concurrent downloads - Manages multiple peer connections to download pieces simultaneously.
- Clean CLI stats - Real-time stats showing a progress bar, percentage completed, pieces downloaded, active peer count, and time elapsed.
- Go
git clone https://github.com/JoelVCrasta/clover.git
cd clover
go build ./cmd/cloverMake sure to move the clover binary to your system or user bin folder so it works from anywhere.
In Linux:
sudo mv ./clover /usr/local/bin/go run ./cmd/clover/main.go -i <path-to-torrent-file> -o <output-directory>
or
clover -i <path-to-torrent-file> -o <output-directory>go run ./cmd/clover/main.go -i ~/downloads/ubuntu.torrent -o ~/downloads/
or
clover -i ~/downloads/ubuntu.torrent -o ~/downloads/go run ./cmd/clover/main.go -i ~/downloads/ubuntu.torrent
or
clover -i ~/downloads/ubuntu.torrentIf the output flag is not provided, then it will download to the ~/Downloads directory.
.
βββ client
β βββ bitfield.go
β βββ client.go
βββ cmd
β βββ clover
β β βββ main.go
β βββ example
β βββ main.go
βββ config
β βββ config.go
βββ dht
β βββ dht.go
βββ download
β βββ download.go
β βββ save.go
βββ handshake
β βββ handshake.go
βββ message
β βββ message.go
βββ metainfo
β βββ decode.go
β βββ encode.go
β βββ hash.go
β βββ torrentfile.go
βββ peer
β βββ peer.go
β βββ peer_id.go
ββββ tracker
β βββ scrape.go
β βββ tracker.go
β βββ tracker_test.go
βββ torrent.go
βββ discover_peers.go
βββ go.mod
βββ go.sum