Jellyfin Login ✓
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user