fix: ip info
This commit is contained in:
@@ -121,7 +121,7 @@ class ProxyRepositoryImpl
|
|||||||
|
|
||||||
final Map<String, IpInfo Function(Map<String, dynamic> response)>
|
final Map<String, IpInfo Function(Map<String, dynamic> response)>
|
||||||
_ipInfoSources = {
|
_ipInfoSources = {
|
||||||
// "https://geolocation-db.com/json/": IpInfo.fromGeolocationDbComJson,
|
// "https://geolocation-db.com/json/": IpInfo.fromGeolocationDbComJson, //bug response is not json
|
||||||
"https://api.ip.sb/geoip/": IpInfo.fromIpSbJson,
|
"https://api.ip.sb/geoip/": IpInfo.fromIpSbJson,
|
||||||
"https://ipapi.co/json/": IpInfo.fromIpApiCoJson,
|
"https://ipapi.co/json/": IpInfo.fromIpApiCoJson,
|
||||||
"https://ipinfo.io/json/": IpInfo.fromIpInfoIoJson,
|
"https://ipinfo.io/json/": IpInfo.fromIpInfoIoJson,
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ class IpInfo with IpInfoMappable {
|
|||||||
const IpInfo({
|
const IpInfo({
|
||||||
required this.ip,
|
required this.ip,
|
||||||
required this.countryCode,
|
required this.countryCode,
|
||||||
required this.region,
|
this.region,
|
||||||
required this.city,
|
this.city,
|
||||||
this.timezone,
|
this.timezone,
|
||||||
this.asn,
|
this.asn,
|
||||||
this.org,
|
this.org,
|
||||||
@@ -16,8 +16,8 @@ class IpInfo with IpInfoMappable {
|
|||||||
|
|
||||||
final String ip;
|
final String ip;
|
||||||
final String countryCode;
|
final String countryCode;
|
||||||
final String region;
|
final String? region;
|
||||||
final String city;
|
final String? city;
|
||||||
final String? timezone;
|
final String? timezone;
|
||||||
final String? asn;
|
final String? asn;
|
||||||
final String? org;
|
final String? org;
|
||||||
@@ -27,16 +27,16 @@ class IpInfo with IpInfoMappable {
|
|||||||
{
|
{
|
||||||
"ip": final String ip,
|
"ip": final String ip,
|
||||||
"country": final String country,
|
"country": final String country,
|
||||||
"region": final String region,
|
// "region": final String region, //sometime is not available
|
||||||
"city": final String city,
|
// "city": final String city,//sometime is not available
|
||||||
"timezone": final String timezone,
|
"timezone": final String timezone,
|
||||||
"org": final String org,
|
"org": final String org,
|
||||||
} =>
|
} =>
|
||||||
IpInfo(
|
IpInfo(
|
||||||
ip: ip,
|
ip: ip,
|
||||||
countryCode: country,
|
countryCode: country,
|
||||||
region: region,
|
// region: region,
|
||||||
city: city,
|
// city: city,
|
||||||
timezone: timezone,
|
timezone: timezone,
|
||||||
org: org,
|
org: org,
|
||||||
),
|
),
|
||||||
@@ -49,8 +49,8 @@ class IpInfo with IpInfoMappable {
|
|||||||
{
|
{
|
||||||
"ip": final String ip,
|
"ip": final String ip,
|
||||||
"country_code": final String countryCode,
|
"country_code": final String countryCode,
|
||||||
"region": final String region,
|
// "region": final String region, //sometime is not available
|
||||||
"city": final String city,
|
// "city": final String city,//sometime is not available
|
||||||
"timezone": final String timezone,
|
"timezone": final String timezone,
|
||||||
"asn": final String asn,
|
"asn": final String asn,
|
||||||
"org": final String org,
|
"org": final String org,
|
||||||
@@ -58,8 +58,8 @@ class IpInfo with IpInfoMappable {
|
|||||||
IpInfo(
|
IpInfo(
|
||||||
ip: ip,
|
ip: ip,
|
||||||
countryCode: countryCode,
|
countryCode: countryCode,
|
||||||
region: region,
|
// region: region,
|
||||||
city: city,
|
// city: city,
|
||||||
timezone: timezone,
|
timezone: timezone,
|
||||||
asn: asn,
|
asn: asn,
|
||||||
org: org,
|
org: org,
|
||||||
@@ -73,8 +73,8 @@ class IpInfo with IpInfoMappable {
|
|||||||
{
|
{
|
||||||
"ip": final String ip,
|
"ip": final String ip,
|
||||||
"country_code": final String countryCode,
|
"country_code": final String countryCode,
|
||||||
"region": final String region,
|
// "region": final String region,
|
||||||
"city": final String city,
|
// "city": final String city,
|
||||||
"timezone": final String timezone,
|
"timezone": final String timezone,
|
||||||
"asn": final int asn,
|
"asn": final int asn,
|
||||||
"asn_organization": final String org,
|
"asn_organization": final String org,
|
||||||
@@ -82,8 +82,8 @@ class IpInfo with IpInfoMappable {
|
|||||||
IpInfo(
|
IpInfo(
|
||||||
ip: ip,
|
ip: ip,
|
||||||
countryCode: countryCode,
|
countryCode: countryCode,
|
||||||
region: region,
|
// region: region,
|
||||||
city: city,
|
// city: city,
|
||||||
timezone: timezone,
|
timezone: timezone,
|
||||||
asn: '$asn',
|
asn: '$asn',
|
||||||
org: org,
|
org: org,
|
||||||
@@ -97,13 +97,13 @@ class IpInfo with IpInfoMappable {
|
|||||||
{
|
{
|
||||||
"ip": final String ip,
|
"ip": final String ip,
|
||||||
"country_code": final String countryCode,
|
"country_code": final String countryCode,
|
||||||
"state": final String region,
|
// "state": final String region,
|
||||||
"city": final String city
|
"city": final String city
|
||||||
} =>
|
} =>
|
||||||
IpInfo(
|
IpInfo(
|
||||||
ip: ip,
|
ip: ip,
|
||||||
countryCode: countryCode,
|
countryCode: countryCode,
|
||||||
region: region,
|
// region: region,
|
||||||
city: city,
|
city: city,
|
||||||
),
|
),
|
||||||
_ => throw const FormatException("invalid json"),
|
_ => throw const FormatException("invalid json"),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//profile-title: base64:8J+UpSBXQVJQIPCflKU=
|
//profile-title: base64:8J+UpSBXQVJQIPCflKU=
|
||||||
//profile-update-interval: 1
|
//profile-update-interval: 24
|
||||||
//subscription-userinfo: upload=0; download=0; total=10737418240000000; expire=2546249531
|
//subscription-userinfo: upload=0; download=0; total=10737418240000000; expire=2546249531
|
||||||
//support-url: https://t.me/hiddify
|
//support-url: https://t.me/hiddify
|
||||||
//profile-web-page-url: https://hiddify.com
|
//profile-web-page-url: https://hiddify.com
|
||||||
|
|||||||
Reference in New Issue
Block a user