def GetServerParms(host, port):
 try:
  int(port)
 except:
  port = 119
 opt = sabnzbd.cfg.ipv6_servers()
 " ... with the following meaning for 'opt':\n    Control the use of IPv6 Usenet server addresses. Meaning:\n    0 = don't use\n    1 = use when available and reachable (DEFAULT)\n    2 = force usage (when SABnzbd's detection fails)\n    "
 try:
  ips = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM)
  if ((opt == 2) or ((opt == 1) and sabnzbd.EXTERNAL_IPV6) or ((opt == 1) and (sabnzbd.cfg.load_balancing() == 2))):
   return ips
  else:
   return [ip for ip in ips if (':' not in ip[4][0])]
 except:
  if ((opt == 2) or ((opt == 1) and sabnzbd.EXTERNAL_IPV6) or ((opt == 1) and (sabnzbd.cfg.load_balancing() == 2))):
   try:
    return socket.getaddrinfo(host, port, socket.AF_INET6, socket.SOCK_STREAM, socket.IPPROTO_IP, socket.AI_CANONNAME)
   except:
    pass
  return None

def GetServerParms ( host , port ) : try : int ( port ) except : port = 119 opt = sabnzbd . cfg . ipv6_servers ( ) try : ips = socket . getaddrinfo ( host , port , 0 , socket . SOCK_STREAM ) if ( ( opt == 2 ) or ( ( opt == 1 ) and sabnzbd . EXTERNAL_IPV6 ) or ( ( opt == 1 ) and ( sabnzbd . cfg . load_balancing ( ) == 2 ) ) ) : return ips else : return [ ip for ip in ips if ( ':' not in ip [ 4 ] [ 0 ] ) ] except : if ( ( opt == 2 ) or ( ( opt == 1 ) and sabnzbd . EXTERNAL_IPV6 ) or ( ( opt == 1 ) and ( sabnzbd . cfg . load_balancing ( ) == 2 ) ) ) : try : return socket . getaddrinfo ( host , port , socket . AF_INET6 , socket . SOCK_STREAM , socket . IPPROTO_IP , socket . AI_CANONNAME ) except : pass return None
return processed getaddrinfo() for server .