Jellyfin Login ✓

This commit is contained in:
2021-02-06 18:41:24 +01:00
parent 6e1067e43e
commit 3852275b74
5 changed files with 85 additions and 117 deletions

View File

@@ -653,19 +653,6 @@ def is_public_ip(host):
return False
def get_ip(host):
ip_address = ''
if is_valid_ip(host):
return host
elif not re.match(r'^[0-9]+(?:\.[0-9]+){3}(?!\d*-[a-z0-9]{6})$', host):
try:
ip_address = socket.getaddrinfo(host, None)[0][4][0]
logger.debug("IP Checker :: Resolved %s to %s." % (host, ip_address))
except:
logger.error("IP Checker :: Bad IP or hostname provided: %s." % host)
return ip_address
def is_valid_ip(address):
try:
return IP(address)