repair app.py

This commit is contained in:
kicap 2024-07-27 21:07:13 +07:00
parent 20edac4cdf
commit e87312e1da
1 changed files with 5 additions and 4 deletions

View File

@ -146,7 +146,8 @@ class App:
def get_host(self): def get_host(self):
ips = gethostbyname_ex(gethostname())[2] ips = gethostbyname_ex(gethostname())[2]
if len(ips) > 1:
for ip in ips: for ip in ips:
if ip.split(".")[2] == "1": if ip.split(".")[2] == "1":
return ip return ip
return ips[1] return ips[0]