code: def _write_warc_metadata(self):
          '''Write the JSON metadata to WARC.
  
          Uses pywb spec.
          '''
          uri = 'metadata://{}{}'.format(self._item_session.url_record.url_info.authority,
                                         self._item_session.url_record.url_info.resource)
  
          glob_pattern = self._path_prefix + '*.info.json'
          filenames = list(glob.glob(glob_pattern))
  
          if not filenames:
              _logger.warning(__(
                  _('Could not find external process metadata file: {filename}'),
                  filename=glob_pattern
              ))
              return
  
          for filename in filenames:
              record = WARCRecord()
              record.set_common_fields('metadata', 'application/vnd.youtube-dl_formats+json')
              record.fields['WARC-Target-URI'] = uri
              record.block_file = open(filename, 'rb')
  
              self._warc_recorder.set_length_and_maybe_checksums(record)
              self._warc_recorder.write_record(record)
  
              record.block_file.close(f _write_warc_metadata(self):
          '''Write the JSON metadata to WARC.
  
          Uses pywb spec.
          '''
          uri = 'metadata://{}{}'.format(self._item_session.url_record.url_info.authority,
                                         self._item_session.url_record.url_info.resource)
  
          glob_pattern = self._path_prefix + '*.info.json'
          filenames = list(glob.glob(glob_pattern))
  
          if not filenames:
              _logger.warning(__(
                  _('Could not find external process metadata file: {filename}'),
                  filename=glob_pattern
              ))
              return
  
          for filename in filenames:
              record = WARCRecord()
              record.set_common_fields('metadata', 'application/vnd.youtube-dl_formats+json')
              record.fields['WARC-Target-URI'] = uri
              record.block_file = open(filename, 'rb')
  
              self._warc_recorder.set_length_and_maybe_checksums(record)
              self._warc_recorder.write_record(record)
  
              record.block_file.close()
docs: Write the JSON metadata to WARC.
  
          Uses pywb spec.