trackers from file

This commit is contained in:
YouROK
2021-04-20 11:01:32 +03:00
parent f87ddc5917
commit 3eb3d9efbc
2 changed files with 24 additions and 0 deletions

View File

@@ -65,6 +65,11 @@ func NewTorrent(spec *torrent.TorrentSpec, bt *BTServer) (*Torrent, error) {
spec.Trackers = [][]string{utils.GetDefTrackers()}
}
trackers := utils.GetTrackerFromFile()
if len(trackers) > 0 {
spec.Trackers = append(spec.Trackers, [][]string{trackers}...)
}
goTorrent, _, err := bt.client.AddTorrentSpec(spec)
if err != nil {
return nil, err