def _api_auth(name, output, kwargs):
 auth = 'None'
 if (not cfg.disable_key()):
  auth = 'badkey'
  key = kwargs.get('key', '')
  if (not key):
   auth = 'apikey'
  else:
   if (key == cfg.nzb_key()):
    auth = 'nzbkey'
   if (key == cfg.api_key()):
    auth = 'apikey'
 elif (cfg.username() and cfg.password()):
  auth = 'login'
 return report(output, keyword='auth', data=auth)

def _api_auth ( name , output , kwargs ) : auth = 'None' if ( not cfg . disable_key ( ) ) : auth = 'badkey' key = kwargs . get ( 'key' , '' ) if ( not key ) : auth = 'apikey' else : if ( key == cfg . nzb_key ( ) ) : auth = 'nzbkey' if ( key == cfg . api_key ( ) ) : auth = 'apikey' elif ( cfg . username ( ) and cfg . password ( ) ) : auth = 'login' return report ( output , keyword = 'auth' , data = auth )
api: accepts output .