From ec3dc5a0269ad6a608e59cb762c6c8d9d1eba5d0 Mon Sep 17 00:00:00 2001 From: monosans Date: Fri, 8 Apr 2022 11:05:57 +0300 Subject: [PATCH] Use | as geolocation separator --- README.md | 2 +- config.py | 2 +- main.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 49fc105..37495c1 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/config.py b/config.py index 161637e..7a10fc2 100644 --- a/config.py +++ b/config.py @@ -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 diff --git a/main.py b/main.py index 4e78771..73821ac 100755 --- a/main.py +++ b/main.py @@ -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: