code: def parse_warc_record(self, record):
          
  
          entry = self._create_index_entry(record.rec_type)
  
          if record.rec_type == 'warcinfo':
              entry['url'] = record.rec_headers.get_header('WARC-Filename')
              entry['urlkey'] = entry['url']
              entry['_warcinfo'] = record.raw_stream.read(record.length)
              return entry
  
          entry['url'] = record.rec_headers.get_header('WARC-Target-Uri')
  
          # timestamp
          entry['timestamp'] = iso_date_to_timestamp(record.rec_headers.
                                                     get_header('WARC-Date'))
  
          # mime
          if record.rec_type == 'revisit':
              entry['mime'] = 'warc/revisit'
          elif self.options.get('minimal'):
              entry['mime'] = '-'
          else:
              def_mime = '-' if record.rec_type == 'request' else 'unk'
              entry.extract_mime(record.http_headers.
                                 get_header('Content-Type'),
                                 def_mime)
              # detected mime from WARC-Identified-Payload-Type
              entry['mime-detected'] = record.rec_headers.get_header(
                                          'WARC-Identified-Payload-Type')
  
          # status -- only for response records (by convention):
          if record.rec_type == 'response' and not self.options.get('minimal'):
              entry.extract_status(record.http_headers)
          else:
              entry['status'] = '-'
  
          # digest
          digest = record.rec_headers.get_header('WARC-Payload-Digest')
          entry['digest'] = digest
          if digest and digest.startswith('sha1:'):
              entry['digest'] = digest[len('sha1:'):]
  
          elif not entry.get('digest'):
              entry['digest'] = '-'
  
          # optional json metadata, if present
          metadata = record.rec_headers.get_header('WARC-Json-Metadata')
          if metadata:
              entry['metadata'] = metadata
  
          return entry
docs: Parse warc record