# btpeer
[](https://deps.rs/repo/codeberg/yggverse/btpeer)
[](https://crates.io/crates/btpeer)
Simple CLI tool and library to get peers from BitTorrent trackers
## Features
Commands:
* [x] Announce - return `interval`, `leechers` and `seeders` count, optional `peers` IP:port array
* [x] Scrape - return `leechers`, `peers`, `seeders` count, `info_hash` array with stats
Tracker protocols:
* [x] UDP
* [x] TCP/HTTP
* [ ] WS
Address family:
* [x] IPv4
* [x] IPv6
* [x] I2P
## Install
``` bash
cargo install btpeer
```
## Usage
Multiple `--tracker`s are supported!
``` bash
btpeer --help
```
### TCP/HTTP
``` bash
btpeer announce -t http://[202:68d0:f0d5:b88d:1d1a:555e:2f6b:3148]:6969/announce -i e337a880c4d0f552bab5b437fe1208d26130ccc5
```
#### SOCKS/Tor
``` bash
all_proxy=socks5h://127.0.0.1:9050 \
btpeer announce -t http://some.onion/announce \
-i e337a880c4d0f552bab5b437fe1208d26130ccc5
```
#### HTTP/I2P
``` bash
all_proxy=http://127.0.0.1:4444 \
btpeer announce -t http://btrackrqkjp6kgelov5a3uxisis77ofxqt5nvy5hvvtoybjpmq4q.b32.i2p/announce \
-i e337a880c4d0f552bab5b437fe1208d26130ccc5
```
* for HTTP proxy: `-P http://127.0.0.1:4444`
* tip: use connection `--timeout` to increase defaults
### UDP
``` bash
btpeer announce -t [202:68d0:f0d5:b88d:1d1a:555e:2f6b:3148]:6969
-i e337a880c4d0f552bab5b437fe1208d26130ccc5
```