mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-13 03:43:41 +00:00
20 lines
500 B
Go
20 lines
500 B
Go
package metainfo
|
|
|
|
import (
|
|
"encoding/hex"
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestParseFromFile(t *testing.T) {
|
|
// metaInfo, err := ParseFromFile("../testdata/Game.of.Thrones.S08E05.720p.WEB.H264-MEMENTO.torrent")
|
|
metaInfo, err := ParseFromFile("../testdata/office.torrent")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Printf("%+v\n", metaInfo.AnnounceList)
|
|
fmt.Printf("%+v\n", metaInfo.Info.Files)
|
|
fmt.Printf("%+v\n", metaInfo.Info.PieceLength)
|
|
fmt.Printf("%+v\n", hex.EncodeToString(metaInfo.infoHash[:]))
|
|
}
|