def get_connection_info(user=True):
 (section, keypath) = reg_info(user)
 url = None
 try:
  hive = _winreg.ConnectRegistry(None, section)
  key = _winreg.OpenKey(hive, (keypath + '\\api'))
  for i in range(0, _winreg.QueryInfoKey(key)[1]):
   (name, value, val_type) = _winreg.EnumValue(key, i)
   if (name == 'url'):
    url = value
  _winreg.CloseKey(key)
 except WindowsError:
  pass
 finally:
  _winreg.CloseKey(hive)
 if (user and (not url)):
  url = get_connection_info(user=False)
 return url

def get_connection_info ( user = True ) : ( section , keypath ) = reg_info ( user ) url = None try : hive = _winreg . ConnectRegistry ( None , section ) key = _winreg . OpenKey ( hive , ( keypath + '\\api' ) ) for i in range ( 0 , _winreg . QueryInfoKey ( key ) [ 1 ] ) : ( name , value , val_type ) = _winreg . EnumValue ( key , i ) if ( name == 'url' ) : url = value _winreg . CloseKey ( key ) except WindowsError : pass finally : _winreg . CloseKey ( hive ) if ( user and ( not url ) ) : url = get_connection_info ( user = False ) return url
return url of the api running sabnzbd instance user == true will first try users registry .