torrent-infohash: utility to print the info hash of a torrent file
This commit is contained in:
parent
1e4862ace8
commit
7928b763d9
|
@ -0,0 +1,19 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/anacrolix/libtorgo/metainfo"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
for _, arg := range flag.Args() {
|
||||
mi, err := metainfo.LoadFromFile(arg)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Printf("%x: %s\n", mi.InfoHash, arg)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue