feat(ip): add InternetData to the IP API list (#10614)

This commit is contained in:
Uman Shahzad
2026-11-16 16:16:39 +05:00
committed by GitHub
parent ba3a31aa85
commit f57b1bf479
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -724,6 +724,7 @@ public class Global
@"https://api-ipv4.ip.sb/geoip", @"https://api-ipv4.ip.sb/geoip",
@"https://api-ipv6.ip.sb/geoip", @"https://api-ipv6.ip.sb/geoip",
@"https://api.ipapi.is", @"https://api.ipapi.is",
@"https://api.internetdata.io/myip",
@"" @""
]; ];
@@ -133,7 +133,7 @@ public static class ConnectionHandler
} }
var ip = ipInfo.ip ?? ipInfo.clientIp ?? ipInfo.ip_addr ?? ipInfo.query; var ip = ipInfo.ip ?? ipInfo.clientIp ?? ipInfo.ip_addr ?? ipInfo.query;
var country = ipInfo.country_code ?? ipInfo.country ?? ipInfo.countryCode ?? ipInfo.location?.country_code ?? "unknown"; var country = ipInfo.country_code ?? ipInfo.country ?? ipInfo.countryCode ?? ipInfo.location?.country_code ?? ipInfo.location?.country ?? "unknown";
return new IpInfoResult(country, ip); return new IpInfoResult(country, ip);
} }
@@ -16,6 +16,7 @@ internal class IPAPIInfo
public class LocationInfo public class LocationInfo
{ {
public string? country_code { get; set; } public string? country_code { get; set; }
public string? country { get; set; }
} }
public readonly record struct IpInfoResult(string Country, string? Ip) public readonly record struct IpInfoResult(string Country, string? Ip)