mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-16 21:33:41 +00:00
25 lines
302 B
Go
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()
|
|
}
|