'Attempt to download a zip file and extract any subtitle file from it, if any.
This cleans up after itself if anything fails.
:param string url: URL of the zip file to download
:param string filepath: destination path for the subtitle'

def download_zip_file(self, url, filepath):

    logger.info((u'Downloading    %s    in    %s' % (url, filepath)))
    try:
        zippath = (filepath + '.zip')
        r = self.session.get(url, timeout=10, headers={'Referer': url, 'User-Agent': self.user_agent})
        with open(zippath, 'wb') as f:
            f.write(r.content)
        if (not zipfile.is_zipfile(zippath)):
            raise DownloadFailedError('Downloaded    file    is    not    a    zip    file')
        with zipfile.ZipFile(zippath) as zipsub:
            for subfile in zipsub.namelist():
                if (os.path.splitext(subfile)[1] in EXTENSIONS):
                    with open(filepath, 'w') as f:
                        f.write(zipsub.open(subfile).read())
                    break
            else:
                raise DownloadFailedError('No    subtitles    found    in    zip    file')
        os.remove(zippath)
    except Exception as e:
        logger.error((u'Download    %s    failed:    %s' % (url, e)))
        if os.path.exists(zippath):
            os.remove(zippath)
        if os.path.exists(filepath):
            os.remove(filepath)
        raise DownloadFailedError(str(e))
    logger.debug(u'Download    finished')
