From b08a700314749f158cf7da5e93cb703d237e0d55 Mon Sep 17 00:00:00 2001 From: dozed-dev <34552968+dozed-dev@users.noreply.github.com> Date: Sun, 8 Jun 2025 19:53:51 +0300 Subject: [PATCH] fix: return correct country from geoip database Return country instead of registered_country for iso code in get_geolocation --- pythonlib/camoufox/locale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonlib/camoufox/locale.py b/pythonlib/camoufox/locale.py index 7a0662a..be91aeb 100644 --- a/pythonlib/camoufox/locale.py +++ b/pythonlib/camoufox/locale.py @@ -259,7 +259,7 @@ def get_geolocation(ip: str) -> Geolocation: with geoip2.database.Reader(str(MMDB_FILE)) as reader: resp = reader.city(ip) - iso_code = cast(str, resp.registered_country.iso_code).upper() + iso_code = cast(str, resp.country.iso_code).upper() location = resp.location # Check if any required attributes are missing