def _add_spider(self, file_path, templates, extractors):
        """
        Add a spider or template to the archive.
        """
        data = self.read_file(file_path, deserialize=True)
        added = {file_path}
        if data is not None and data.get('deleted'):
            return self._deleted_spider(file_path, data, templates)

        spider_content = json.dumps(data, sort_keys=True, indent=4)
        return file_path, spider_content.encode('utf-8'), added

        Add a spider or template to the archive.
        
portia_server/portia_api/utils/download.py