Files
gopeed/down/bt/torrent.go
T
2019-05-31 18:29:04 +08:00

25 lines
302 B
Go

package bt
import (
"fmt"
)
type Torrent struct {
client *Client
MetaInfo *MetaInfo
Peers []Peer
}
func (torrent *Torrent) Download() {
t := NewTracker(torrent)
peers, err := t.Tracker()
if err != nil {
fmt.Println(err)
return
}
peers[0].Torrent = torrent
peers[0].DoDownload()
}