Use | as geolocation separator

This commit is contained in:
monosans
2022-04-08 11:05:57 +03:00
parent 9d5b61ea0c
commit ec3dc5a026
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ When the script finishes running, the following folders will be created (this be
- `proxies_geolocation` - same as `proxies`, but including exit-node's geolocation.
- `proxies_geolocation_anonymous` - same as `proxies_anonymous`, but including exit-node's geolocation.
Geolocation format is `ip:port::Country::Region::City`.
Geolocation format is `ip:port|Country|Region|City`.
## Buy me a coffee
+1 -1
View File
@@ -24,7 +24,7 @@ PROXIES = True
# Anonymous proxies.
PROXIES_ANONYMOUS = True
# Same as PROXIES, but including exit-node's geolocation.
# Geolocation format is ip:port::Country::Region::City
# Geolocation format is ip:port|Country|Region|City
PROXIES_GEOLOCATION = True
# Same as PROXIES_GEOLOCATION, but including exit-node's geolocation.
PROXIES_GEOLOCATION_ANONYMOUS = True
+2 -2
View File
@@ -32,7 +32,7 @@ class Proxy:
self.socket_address = socket_address
self.ip = ip
self.is_anonymous: Optional[bool] = None
self.geolocation: str = "::None::None::None"
self.geolocation: str = "|None|None|None"
self.timeout = float("inf")
def update(self, info: Dict[str, str]) -> None:
@@ -44,7 +44,7 @@ class Proxy:
country = info.get("country") or None
region = info.get("regionName") or None
city = info.get("city") or None
self.geolocation = f"::{country}::{region}::{city}"
self.geolocation = f"|{country}|{region}|{city}"
self.is_anonymous = self.ip != info.get("query")
def __eq__(self, other: object) -> bool: