@@ -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