def _api_addurl(names, output, kwargs):
 pp = kwargs.get('pp')
 script = kwargs.get('script')
 cat = kwargs.get('cat')
 priority = kwargs.get('priority')
 nzbnames = kwargs.get('nzbname')
 if (not isinstance(names, list)):
  names = [names]
 if (not isinstance(nzbnames, list)):
  nzbnames = [nzbnames]
 nzo_ids = []
 for n in xrange(len(names)):
  name = names[n]
  if (n < len(nzbnames)):
   nzbname = nzbnames[n]
  else:
   nzbname = ''
  if name:
   name = name.strip()
  if name:
   nzo_ids.append(sabnzbd.add_url(name, pp, script, cat, priority, nzbname))
 if (len(names) > 0):
  return report(output, keyword='', data={'status': True, 'nzo_ids': nzo_ids}, compat=True)
 else:
  logging.info('API-call addurl: no files retrieved from %s', names)
  return report(output, _MSG_NO_VALUE)

def _api_addurl ( names , output , kwargs ) : pp = kwargs . get ( 'pp' ) script = kwargs . get ( 'script' ) cat = kwargs . get ( 'cat' ) priority = kwargs . get ( 'priority' ) nzbnames = kwargs . get ( 'nzbname' ) if ( not isinstance ( names , list ) ) : names = [ names ] if ( not isinstance ( nzbnames , list ) ) : nzbnames = [ nzbnames ] nzo_ids = [ ] for n in xrange ( len ( names ) ) : name = names [ n ] if ( n < len ( nzbnames ) ) : nzbname = nzbnames [ n ] else : nzbname = '' if name : name = name . strip ( ) if name : nzo_ids . append ( sabnzbd . add_url ( name , pp , script , cat , priority , nzbname ) ) if ( len ( names ) > 0 ) : return report ( output , keyword = '' , data = { 'status' : True , 'nzo_ids' : nzo_ids } , compat = True ) else : logging . info ( 'API-call addurl: no files retrieved from %s' , names ) return report ( output , _MSG_NO_VALUE )
api: accepts name .