diff --git a/v2rayN/ServiceLib/Global.cs b/v2rayN/ServiceLib/Global.cs index 4a4e89d9..c0518b42 100644 --- a/v2rayN/ServiceLib/Global.cs +++ b/v2rayN/ServiceLib/Global.cs @@ -20,7 +20,7 @@ public const string JuicityCoreUrl = "https://github.com/juicity/juicity/releases"; public const string CustomRoutingListUrl = @"https://raw.githubusercontent.com/2dust/v2rayCustomRoutingList/master/"; public const string SingboxRulesetUrl = @"https://raw.githubusercontent.com/2dust/sing-box-rules/rule-set-{0}/{1}.srs"; - public const string IPAPIUrl = "https://ipapi.co/json"; + public const string IPAPIUrl = "https://api.ip.sb/geoip"; public const string PromotionUrl = @"aHR0cHM6Ly85LjIzNDQ1Ni54eXovYWJjLmh0bWw="; public const string ConfigFileName = "guiNConfig.json"; diff --git a/v2rayN/ServiceLib/Services/UpdateService.cs b/v2rayN/ServiceLib/Services/UpdateService.cs index 7ce7975f..bd0f6a2b 100644 --- a/v2rayN/ServiceLib/Services/UpdateService.cs +++ b/v2rayN/ServiceLib/Services/UpdateService.cs @@ -249,9 +249,9 @@ namespace ServiceLib.Services var ip = Global.None; if (time > 0) { - var result = await downloadHandle.TryDownloadString(Global.IPAPIUrl, true, "ipapi"); + var result = await downloadHandle.TryDownloadString(Global.IPAPIUrl, true, Global.IPAPIUrl); var ipInfo = JsonUtils.Deserialize(result); - ip = $"({ipInfo?.country}) {ipInfo?.ip}"; + ip = $"({ipInfo?.country_code}) {ipInfo?.ip}"; } updateFunc?.Invoke(false, string.Format(ResUI.TestMeOutput, time, ip));