mirror of
https://github.com/lijiejie/eyes.sh.git
synced 2026-09-27 03:51:52 +08:00
small fix
This commit is contained in:
+1
-1
@@ -24,7 +24,7 @@ from django.utils.translation import gettext as _
|
|||||||
|
|
||||||
def get_city_by_ip(ip):
|
def get_city_by_ip(ip):
|
||||||
try:
|
try:
|
||||||
doc = requests.get('https://whois.pconline.com.cn/ip.jsp?ip=%s' % ip).text
|
doc = requests.get('https://whois.pconline.com.cn/ip.jsp?ip=%s' % ip).text.strip()
|
||||||
city = doc.split(' ')[0]
|
city = doc.split(' ')[0]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
city = ''
|
city = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user