code: def get_directory_as_zip(self, remote_path, local_file):
          
          remote_path = self._normalize_path(remote_path)
          url = self.url + 'index.php/apps/files/ajax/download.php?dir=' \
                + parse.quote(remote_path)
          res = self._session.get(url, stream=True)
          if res.status_code == 200:
              if local_file is None:
                  # use downloaded file name from Content-Disposition
                  # targetFile = res.headers['content-disposition']
                  local_file = os.path.basename(remote_path)
  
              file_handle = open(local_file, 'wb', 8192)
              for chunk in res.iter_content(8192):
                  file_handle.write(chunk)
              file_handle.close()
              return True
          elif res.status_code >= 400:
              raise HTTPResponseError(res)
          return False
docs: Downloads a remote directory as zip
  
          :param remote_path: path to the remote directory to download
          :param local_file: path and name of the target local file
          :returns: True if the operation succeeded, False otherwise
          :raises: HTTPResponseError in case an HTTP error status was returned