mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-06 07:26:39 -04:00
hotfix(pia): fix servers data updater and update servers data
- use v7 API endpoint to get correct list of servers - skip offline regions - do not skip *.pvt.site
This commit is contained in:
@@ -36,7 +36,7 @@ type serverData struct {
|
||||
func fetchAPI(ctx context.Context, client *http.Client) (
|
||||
data apiData, err error,
|
||||
) {
|
||||
const url = "https://serverlist.piaservers.net/vpninfo/servers/v6"
|
||||
const url = "https://serverlist.piaservers.net/vpninfo/servers/v7"
|
||||
|
||||
request, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
|
||||
if err != nil {
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
@@ -78,7 +77,7 @@ func (u *Updater) FetchServers(ctx context.Context, minServers int) (
|
||||
|
||||
func addData(regions []regionData, nts nameToServer) (change bool) {
|
||||
for _, region := range regions {
|
||||
if strings.HasSuffix(region.DNS, "pvt.site") {
|
||||
if region.Offline {
|
||||
continue
|
||||
}
|
||||
for _, server := range region.Servers.UDP {
|
||||
|
||||
+6962
-1185
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user