feat(fastestvpn): update servers data using API instead of zip file

- Add city filter
- More dynamic to servers updates on fastestvpn's end
- Update servers data
This commit is contained in:
Quentin McGaw
2024-07-30 14:50:32 +00:00
parent 8c730a6e4a
commit ab08a5e666
9 changed files with 640 additions and 364 deletions
@@ -9,12 +9,19 @@ import (
type hostToServer map[string]models.Server
func (hts hostToServer) add(host, country string, tcp, udp bool) {
func (hts hostToServer) add(host, country, city string, tcp, udp bool) {
server, ok := hts[host]
if !ok {
server.VPN = vpn.OpenVPN
server.Hostname = host
server.Country = country
server.City = city
}
if city != "" {
// some servers are listed without the city although
// they are also listed with the city described, so update
// the city field.
server.City = city
}
if tcp {
server.TCP = true