Revert "Merge pull request #64 from Aerglonus/dev"
This reverts commit55bc2b16ee, reversing changes made to8c8c9368ba.
This commit is contained in:
@@ -359,13 +359,7 @@ def get_ip_info(session: Optional[requests.Session] = None) -> dict:
|
||||
If you provide a Requests Session with a Proxy, that proxies IP information
|
||||
is what will be returned.
|
||||
"""
|
||||
try:
|
||||
response = (session or requests.Session()).get("https://ipinfo.io/json", timeout=10)
|
||||
if response.ok:
|
||||
return response.json()
|
||||
except (requests.RequestException, json.JSONDecodeError):
|
||||
pass
|
||||
return None
|
||||
return (session or requests.Session()).get("https://ipinfo.io/json").json()
|
||||
|
||||
|
||||
def get_cached_ip_info(session: Optional[requests.Session] = None) -> Optional[dict]:
|
||||
|
||||
Reference in New Issue
Block a user