'Send a torrent/nzb file to the downloader
:param data: dict returned from provider
Contains the release information
:param media: media dict with information
Used for creating the filename when possible
:param filedata: downloaded torrent/nzb filedata
The file gets downloaded in the searcher and send to this function
This is done to have failed checking before using the downloader, so the downloader
doesn\'t need to worry about that
:return: boolean
One faile returns false, but the downloaded should log his own errors'

def download(self, data=None, media=None, filedata=None):

    if (not media):
        media = {}
    if (not data):
        data = {}
    log.info('Sending    "%s"    to    SABnzbd.', data.get('name'))
    req_params = {'cat': self.conf('category'), 'mode': 'addurl', 'nzbname': self.createNzbName(data, media), 'priority': self.conf('priority')}
    nzb_filename = None
    if filedata:
        if (len(filedata) < 50):
            log.error('No    proper    nzb    available:    %s', filedata)
            return False
        nzb_filename = self.createFileName(data, filedata, media)
        req_params['mode'] = 'addfile'
    else:
        req_params['name'] = data.get('url')
    try:
        if (nzb_filename and (req_params.get('mode') is 'addfile')):
            sab_data = self.call(req_params, files={'nzbfile': (ss(nzb_filename), filedata)})
        else:
            sab_data = self.call(req_params)
    except URLError:
        log.error('Failed    sending    release,    probably    wrong    HOST:    %s', traceback.format_exc(0))
        return False
    except:
        log.error('Failed    sending    release,    use    API    key,    NOT    the    NZB    key:    %s', traceback.format_exc(0))
        return False
    log.debug('Result    from    SAB:    %s', sab_data)
    nzo_ids = sab_data.get('nzo_ids', [])
    if (sab_data.get('status') and (not sab_data.get('error')) and isinstance(nzo_ids, list) and (len(nzo_ids) > 0)):
        log.info('NZB    sent    to    SAB    successfully.')
        if filedata:
            return self.downloadReturnId(nzo_ids[0])
        else:
            return True
    else:
        log.error('Error    getting    data    from    SABNZBd:    %s', sab_data)
        return False
