Use | as geolocation separator
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user