Skip to content

Commit 3179a1d

Browse files
committed
fix:删除默认的错误的地址设置
1 parent f683d77 commit 3179a1d

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

transnation/YouTube.go

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func Youtube(c *http.Client) model.Result {
5555
strings.Contains(body1, "/月") || strings.Contains(body1, "/month") {
5656
result1, result2, result3 := utils.CheckDNS(hostname)
5757
unlockType := utils.GetUnlockType(result1, result2, result3)
58-
return model.Result{Name: name, Status: model.StatusYes, UnlockType: unlockType, Region: "us"}
58+
return model.Result{Name: name, Status: model.StatusYes, UnlockType: unlockType}
5959
}
6060
return model.Result{Name: name, Status: model.StatusNo}
6161
}
@@ -95,11 +95,22 @@ func YoutubeCDN(c *http.Client) model.Result {
9595
result1, result2, result3 := utils.CheckDNS(hostname)
9696
unlockType := utils.GetUnlockType(result1, result2, result3)
9797
if i == -1 {
98+
// 没有 - 分隔符,可能是 fra15s37 或 xxx.xxx 格式
9899
i = strings.Index(body, ".")
99-
return model.Result{
100-
Name: name, Status: model.StatusYes, Info: "Youtube Video Server",
101-
Region: findAirCode(body[i+1:]),
102-
UnlockType: unlockType,
100+
if i != -1 {
101+
// 有 . 分隔符,如 server.location
102+
return model.Result{
103+
Name: name, Status: model.StatusYes, Info: "Youtube Video Server",
104+
Region: findAirCode(body[i+1:]),
105+
UnlockType: unlockType,
106+
}
107+
} else {
108+
// 没有 . 分隔符,直接提取字母部分作为机场代码,如 fra15s37
109+
return model.Result{
110+
Name: name, Status: model.StatusYes, Info: "Youtube Video Server",
111+
Region: findAirCode(body),
112+
UnlockType: unlockType,
113+
}
103114
}
104115
} else {
105116
isp := body[:i]

0 commit comments

Comments
 (0)