Spaces:
Sleeping
Sleeping
feat: show initial geoip with given proxy settings (#500)
Browse files- modules/utils.py +2 -1
modules/utils.py
CHANGED
@@ -375,7 +375,8 @@ def replace_today(prompt):
|
|
375 |
|
376 |
def get_geoip():
|
377 |
try:
|
378 |
-
|
|
|
379 |
data = response.json()
|
380 |
except:
|
381 |
data = {"error": True, "reason": "连接ipapi失败"}
|
|
|
375 |
|
376 |
def get_geoip():
|
377 |
try:
|
378 |
+
with retrieve_proxy():
|
379 |
+
response = requests.get("https://ipapi.co/json/", timeout=5)
|
380 |
data = response.json()
|
381 |
except:
|
382 |
data = {"error": True, "reason": "连接ipapi失败"}
|