wget 的に使える bittorrent ダウンロードコマンドの tget コマンド

tget という wget 的に利用できる bittorrent コマンドを試してみました．

sweetbbak/tget: wget but for torrents

GitHub – sweetbbak/tget: wget but for torrents : r/commandline

go install で導入しました．

install & help

$ go install github.com/sweetbbak/tget@latest
$ which tget
/home/matoken/go/bin/tget
$ tget --help
Usage:
tget [OPTIONS]

Application Options:
-t, --torrent= path to torrent or magnet link
-o, --output= path to a directory to output the torrent (default: /home/matoken)
-4, --ipv4 dont use ipv6
-q, --quiet dont output text or progress bar
-n, --no-cleanup dont delete torrent database files on exit

Help Options:
-h, --help Show this help message

今回 Debian の iso image で試してみました．torrent file をダウンロードしなくても url をそのまま渡しても大丈夫でした．
logo はカラーじゃないとうまく見えません．

$ tget -t https://cdimage.debian.org/debian-cd/current/amd64/bt-cd/debian-12.5.0-amd64-netinst.iso.torrent
████████ ██████ ███████ ████████
██ ██ ██ ██
██ ██ ███ █████ ██
██ ██ ██ ██ ██
██ ██████ ███████ ██

SUCCESS Downloaded torrent file
SUCCESS Got torrent info!
debian-12.5.0-amd64-netinst.iso
peers [50] [051/100] ██████████████████████████████████████████████ 51% | 7m33s[2024-03-09 02:39:29 +0900 WRN github.com/anacrolix/torrent client.go:1577]
dropping peer *torrent.PeerConn 0xc000fc8008 [id="-qB4630-(FmL4fYxaelg", exts=0000000000100005 (ltep, fast, dht), v="qBittorrent/4.6.3"] with banned ip 192.140.152.200
peers [49] [100/100] ██████████████████████ 100% | 14m30s ███████████████ 100% | 14m30sss
SUCCESS Downloaded: debian-12.5.0-amd64-netinst.iso

検証

$ wget https://cdimage.debian.org/debian-cd/current/amd64/bt-cd/SHA512SUMS \
https://cdimage.debian.org/debian-cd/current/amd64/bt-cd/SHA512SUMS.sign
$ sha512sum --ignore-missing --check ./SHA512SUMS
debian-12.4.0-amd64-netinst.iso: OK
$ gpg --verify ./SHA512SUMS.sign
gpg: assuming signed data in './SHA512SUMS'
gpg: Signature made Mon Dec 11 09:46:27 2023 JST
gpg: using RSA key DF9B9C49EAA9298432589D76DA87E80D6294BE9B
gpg: Good signature from "Debian CD signing key <debian-cd@lists.debian.org>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: DF9B 9C49 EAA9 2984 3258 9D76 DA87 E80D 6294 BE9B

Index of /debian-cd/current/amd64/bt-cd

Debian CD の信頼性の検証

お手軽に使えます．でもダウンロードが終わると seed せずに終了してしまいます．seed する機能は実装予定とのことなのでそれまでは lftp コマンドなどを使ったほうが良さそうです．

LFTP – sophisticated file transfer program

aria2

環境

$ ls ~/go/pkg/mod/github.com/sweetbbak/
tget@v0.0.0-20240308040335-76c53b4462e7
$ dpkg-query -W golang
golang:amd64 2:1.22~3
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux trixie/sid
Release: n/a
Codename: trixie
$ arch
x86_64