mirror of
https://github.com/lijiejie/eyes.sh.git
synced 2026-09-22 01:30:43 +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):
|
||||
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]
|
||||
except Exception as e:
|
||||
city = ''
|
||||
|
||||
Reference in New Issue
Block a user