Add country flag emoji before country code in each proxy name field, some typo fix

This commit is contained in:
Sparkvix
2020-08-25 13:41:59 -04:00
parent cedd5b4ec4
commit 2f731b0acb
3 changed files with 2008 additions and 7 deletions

2000
assets/flags.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -51,9 +51,9 @@ func CrawlGo() {
cache.LastCrawlTime = time.Now().In(location).Format("2006-01-02 15:04:05")
// 可用性检测
log.Println("Now check proxy health...")
log.Println("Now proceed proxy health check...")
proxies = proxy.CleanBadProxiesWithGrpool(proxies)
log.Println("CrawlGo clash usefull node count:", len(proxies))
log.Println("CrawlGo clash usable node count:", len(proxies))
proxies.NameReIndex()
cache.SetProxies("proxies", proxies)
cache.UsefullProxiesCount = proxies.Len()

View File

@@ -71,8 +71,8 @@ func (ps ProxyList) NameAddCounrty() ProxyList {
go func() {
defer wg.Done()
_, country, err := geoIp.Find(ps[ii].BaseInfo().Server)
if err != nil || country == "" {
country = "ZZ"
if err != nil {
country = "🏁 ZZ"
}
ps[ii].SetName(fmt.Sprintf("%s", country))
//ps[ii].SetIP(ip)
@@ -85,7 +85,7 @@ func (ps ProxyList) NameAddCounrty() ProxyList {
func (ps ProxyList) NameAddIndex() ProxyList {
num := len(ps)
for i := 0; i < num; i++ {
ps[i].SetName(fmt.Sprintf("%s_%d", ps[i].BaseInfo().Name, i+1))
ps[i].SetName(fmt.Sprintf("%s_%+02v", ps[i].BaseInfo().Name, i+1))
}
return ps
}
@@ -94,8 +94,9 @@ func (ps ProxyList) NameReIndex() ProxyList {
num := len(ps)
for i := 0; i < num; i++ {
originName := ps[i].BaseInfo().Name
country := string([]rune(originName)[:2])
ps[i].SetName(fmt.Sprintf("%s_%d", country, i+1))
// country := string([]rune(originName)[:2])
country := string([]rune(originName)[:5])
ps[i].SetName(fmt.Sprintf("%s_%+02v", country, i+1))
}
return ps
}