Update stats.go (#1672)
Cette révision appartient à :
Parent
054a0e07a2
révision
2f0e06cfe4
1 fichiers modifiés avec 7 ajouts et 5 suppressions
|
@ -27,12 +27,14 @@ func GetStatsHandler(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var Trackers []string
|
var Trackers []string
|
||||||
for _, line := range strings.Split(torrent.Trackers[3:], "&tr=") {
|
if len(Trackers) > 3 {
|
||||||
tracker, error := url.QueryUnescape(line)
|
for _, line := range strings.Split(torrent.Trackers[3:], "&tr=") {
|
||||||
if error == nil && strings.Contains(tracker, "udp://") {
|
tracker, error := url.QueryUnescape(line)
|
||||||
Trackers = append(Trackers, tracker)
|
if error == nil && strings.Contains(tracker, "udp://") {
|
||||||
|
Trackers = append(Trackers, tracker)
|
||||||
|
}
|
||||||
|
//Cannot scrape from http trackers so don't put them in the array
|
||||||
}
|
}
|
||||||
//Cannot scrape from http trackers so don't put them in the array
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, line := range config.Get().Torrents.Trackers.Default {
|
for _, line := range config.Get().Torrents.Trackers.Default {
|
||||||
|
|
Référencer dans un nouveau ticket