def _ParseUrl(
      self, parser_mediator, format_version, cache_directories, msiecf_item,
      recovered=False):
    """Extract data from a MSIE Cache Files (MSIECF) URL item.

    Every item is stored as an event object, one for each timestamp.

    Args:
      parser_mediator (ParserMediator): mediates interactions between parsers
          and other components, such as storage and dfvfs.
      format_version (str): MSIECF format version.
      cache_directories (list[str]): cache directory names.
      msiecf_item (pymsiecf.url): MSIECF URL item.
      recovered (Optional[bool]): True if the item was recovered.
    """
    # The secondary time can be stored in either UTC or local time
    # this is dependent on what the index.dat file is used for.
    # Either the file path or location string can be used to distinguish
    # between the different type of files.
    timestamp = msiecf_item.get_primary_time_as_integer()
    if not timestamp:
      primary_date_time = dfdatetime_semantic_time.SemanticTime('Not set')
    else:
      primary_date_time = dfdatetime_filetime.Filetime(timestamp=timestamp)
    primary_date_time_description = 'Primary Time'

    timestamp = msiecf_item.get_secondary_time_as_integer()
    secondary_date_time = dfdatetime_filetime.Filetime(timestamp=timestamp)
    secondary_date_time_description = 'Secondary Time'

    if msiecf_item.type:
      if msiecf_item.type == 'cache':
        primary_date_time_description = definitions.TIME_DESCRIPTION_LAST_ACCESS
        secondary_date_time_description = (
            definitions.TIME_DESCRIPTION_MODIFICATION)

      elif msiecf_item.type == 'cookie':
        primary_date_time_description = definitions.TIME_DESCRIPTION_LAST_ACCESS
        secondary_date_time_description = (
            definitions.TIME_DESCRIPTION_MODIFICATION)

      elif msiecf_item.type == 'history':
        primary_date_time_description = (
            definitions.TIME_DESCRIPTION_LAST_VISITED)
        secondary_date_time_description = (
            definitions.TIME_DESCRIPTION_LAST_VISITED)

      elif msiecf_item.type == 'history-daily':
        primary_date_time_description = (
            definitions.TIME_DESCRIPTION_LAST_VISITED)
        secondary_date_time_description = (
            definitions.TIME_DESCRIPTION_LAST_VISITED)
        # The secondary_date_time is in localtime normalize it to be in UTC.
        secondary_date_time.is_local_time = True

      elif msiecf_item.type == 'history-weekly':
        primary_date_time_description = definitions.TIME_DESCRIPTION_CREATION
        secondary_date_time_description = (
            definitions.TIME_DESCRIPTION_LAST_VISITED)
        # The secondary_date_time is in localtime normalize it to be in UTC.
        secondary_date_time.is_local_time = True

    http_headers = ''
    if msiecf_item.type and msiecf_item.data:
      if msiecf_item.type == 'cache':
        if msiecf_item.data[:4] == b'HTTP':
          # Make sure the HTTP headers are ASCII encoded.
          # TODO: determine correct encoding currently indications that
          # this could be the system narrow string codepage.
          try:
            http_headers = msiecf_item.data[:-1].decode('ascii')
          except UnicodeDecodeError:
            parser_mediator.ProduceExtractionWarning((
                'unable to decode HTTP headers of URL record at offset: '
                '0x{0:08x}. Characters that cannot be decoded will be '
                'replaced with "?" or "\\ufffd".').format(msiecf_item.offset))
            http_headers = msiecf_item.data[:-1].decode(
                'ascii', errors='replace')

      # TODO: parse data of other URL item type like history which requires
      # OLE VT parsing.

    event_data = MSIECFURLEventData()
    event_data.cached_filename = msiecf_item.filename
    event_data.cached_file_size = msiecf_item.cached_file_size
    event_data.cache_directory_index = msiecf_item.cache_directory_index
    event_data.http_headers = http_headers
    event_data.number_of_hits = msiecf_item.number_of_hits
    event_data.offset = msiecf_item.offset
    event_data.recovered = recovered
    event_data.url = msiecf_item.location

    if (event_data.cache_directory_index >= 0 and
        event_data.cache_directory_index < len(cache_directories)):
      event_data.cache_directory_name = (
          cache_directories[event_data.cache_directory_index])

    event = time_events.DateTimeValuesEvent(
        primary_date_time, primary_date_time_description)
    parser_mediator.ProduceEventWithEventData(event, event_data)

    if secondary_date_time.timestamp != 0:
      event = time_events.DateTimeValuesEvent(
          secondary_date_time, secondary_date_time_description,
          time_zone=parser_mediator.timezone)
      parser_mediator.ProduceEventWithEventData(event, event_data)

    expiration_timestamp = msiecf_item.get_expiration_time_as_integer()
    if expiration_timestamp != 0:
      # The expiration time in MSIECF version 4.7 is stored as a FILETIME value
      # in version 5.2 it is stored as a FAT date time value.
      # Since the as_integer function returns the raw integer value we need to
      # apply the right conversion here.
      if format_version == '4.7':
        if expiration_timestamp == 0x7fffffffffffffff:
          expiration_date_time = dfdatetime_semantic_time.SemanticTime('Never')
        else:
          expiration_date_time = dfdatetime_filetime.Filetime(
              timestamp=expiration_timestamp)
      else:
        if expiration_timestamp == 0xffffffff:
          expiration_date_time = dfdatetime_semantic_time.SemanticTime('Never')
        else:
          expiration_date_time = dfdatetime_fat_date_time.FATDateTime(
              fat_date_time=expiration_timestamp)

      event = time_events.DateTimeValuesEvent(
          expiration_date_time, definitions.TIME_DESCRIPTION_EXPIRATION)
      parser_mediator.ProduceEventWithEventData(event, event_data)

    last_checked_timestamp = msiecf_item.get_last_checked_time_as_integer()
    if last_checked_timestamp != 0:
      last_checked_date_time = dfdatetime_fat_date_time.FATDateTime(
          fat_date_time=last_checked_timestamp)

      event = time_events.DateTimeValuesEvent(
          last_checked_date_time, definitions.TIME_DESCRIPTION_LAST_CHECKED)
      parser_mediator.ProduceEventWithEventData(event, event_data)
Extract data from a MSIE Cache Files (MSIECF) URL item.

    Every item is stored as an event object, one for each timestamp.

    Args:
      parser_mediator (ParserMediator): mediates interactions between parsers
          and other components, such as storage and dfvfs.
      format_version (str): MSIECF format version.
      cache_directories (list[str]): cache directory names.
      msiecf_item (pymsiecf.url): MSIECF URL item.
      recovered (Optional[bool]): True if the item was recovered.