diff --git a/parser/vless.go b/parser/vless.go index ff54a7a..8e967b6 100644 --- a/parser/vless.go +++ b/parser/vless.go @@ -72,10 +72,16 @@ func ParseVless(proxy string) (model.Proxy, error) { if strings.Contains(serverInfo[1], "|") { result.Name = strings.SplitN(serverInfo[1], "|", 2)[1] } else { - result.Name = serverInfo[1] + result.Name, err = url.QueryUnescape(serverInfo[1]) + if err != nil { + return model.Proxy{}, err + } } } else { - result.Name = serverAndPort[0] + result.Name, err = url.QueryUnescape(serverAndPort[0]) + if err != nil { + return model.Proxy{}, err + } } return result, nil } diff --git a/parser/vmess.go b/parser/vmess.go index b7a1e9b..6250799 100644 --- a/parser/vmess.go +++ b/parser/vmess.go @@ -3,6 +3,7 @@ package parser import ( "encoding/json" "errors" + "net/url" "strconv" "strings" "sub2clash/model" @@ -56,9 +57,13 @@ func ParseVmess(proxy string) (model.Proxy, error) { if vmess.Net == "ws" && vmess.Host == "" { vmess.Host = vmess.Add } + name, err := url.QueryUnescape(vmess.Ps) + if err != nil { + name = vmess.Ps + } // θΏ”ε›žη»“ζžœ result := model.Proxy{ - Name: vmess.Ps, + Name: name, Type: "vmess", Server: vmess.Add, Port: port,