'Attempt to download a file and remove it in case of failure
:param string url: URL to download
:param string filepath: destination path'

def download_file(self, url, filepath):

    logger.info((u'Downloading    %s    in    %s' % (url, filepath)))
    try:
        r = self.session.get(url, timeout=10, headers={'Referer': url, 'User-Agent': self.user_agent})
        with open(filepath, 'wb') as f:
            f.write(r.content)
    except Exception as e:
        logger.error((u'Download    failed:    %s' % e))
        if os.path.exists(filepath):
            os.remove(filepath)
        raise DownloadFailedError(str(e))
    logger.debug(u'Download    finished')
