Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/archiveorg.py (Python)

Code before:
            capture_dates.append(all_captures[0])

        if 'captures' in self._configuration_arg('check_all'):
            capture_dates.extend(modern_captures + all_captures)

        # Fallbacks if any of the above fail
        capture_dates.extend([self._OLDEST_CAPTURE_DATE, self._NEWEST_CAPTURE_DATE])
        return orderedSet(filter(None, capture_dates))

    def _real_extract(self, url):
        video_id, url_date, url_date_2 = self._match_valid_url(url).group('id', 'date', 'date2')
        url_date = url_date or url_date_2

        urlh = None
        retry_manager = self.RetryManager(fatal=False)
        for retry in retry_manager:
            try:
                urlh = self._request_webpage(
                    HEADRequest('https://web.archive.org/web/2oe_/http://wayback-fakeurl.archive.org/yt/%s' % video_id),
                    video_id, note='Fetching archived video file url', expected_status=True)
            except ExtractorError as e:
                retry.error = e
                # HTTP Error 404 is expected if the video is not saved.
                if isinstance(e.cause, compat_HTTPError) and e.cause.code == 404:
                    self.raise_no_formats(
                        'The requested video is not archived, indexed, or there is an issue with web.archive.org', expected=True)

        if retry_manager.error:
            self.raise_no_formats(retry_manager.error, expected=True, video_id=video_id)

        capture_dates = self._get_capture_dates(video_id, int_or_none(url_date))
        self.write_debug('Captures to try: ' + join_nonempty(*capture_dates, delim=', '))
        info = {'id': video_id}
        for capture in capture_dates:
            webpage = self._download_webpage(
                (self._WAYBACK_BASE_URL + 'http://www.youtube.com/watch?v=%s') % (capture, video_id),
                video_id=video_id, fatal=False, errnote='unable to download capture webpage (it may not be archived)',
                note='Downloading capture webpage')
            current_info = self._extract_metadata(video_id, webpage or '')
            # Try avoid getting deleted video metadata
            if current_info.get('title'):
                info = merge_dicts(info, current_info)
                if 'captures' not in self._configuration_arg('check_all'):
                    break

        info['thumbnails'] = self._extract_thumbnails(video_id)

        if urlh:
            url = compat_urllib_parse_unquote(urlh.geturl())
            video_file_url_qs = parse_qs(url)
            # Attempt to recover any ext & format info from playback url & response headers

Review comment (suggestion):
```suggestion
                # HTTP Error 404 is expected if the video is not saved.
                if isinstance(e.cause, compat_HTTPError) and e.cause.code == 404:
                    self.raise_no_formats(
                        'The requested video is not archived, indexed, or there is an issue with web.archive.org', expected=True)
                else:
                    retry.error = e
```
So that it doesnt retry when `--ignore-no-format-error`

Code after:
        if 'captures' in self._configuration_arg('check_all'):
            capture_dates.extend(modern_captures + all_captures)

        # Fallbacks if any of the above fail
        capture_dates.extend([self._OLDEST_CAPTURE_DATE, self._NEWEST_CAPTURE_DATE])
        return orderedSet(filter(None, capture_dates))

    def _real_extract(self, url):
        video_id, url_date, url_date_2 = self._match_valid_url(url).group('id', 'date', 'date2')
        url_date = url_date or url_date_2

        urlh = None
        retry_manager = self.RetryManager(fatal=False)
        for retry in retry_manager:
            try:
                urlh = self._request_webpage(
                    HEADRequest('https://web.archive.org/web/2oe_/http://wayback-fakeurl.archive.org/yt/%s' % video_id),
                    video_id, note='Fetching archived video file url', expected_status=True)
            except ExtractorError as e:
                # HTTP Error 404 is expected if the video is not saved.
                if isinstance(e.cause, compat_HTTPError) and e.cause.code == 404:
                    self.raise_no_formats(
                        'The requested video is not archived, indexed, or there is an issue with web.archive.org (try again later)', expected=True)
                else:
                    retry.error = e

        if retry_manager.error:
            self.raise_no_formats(retry_manager.error, expected=True, video_id=video_id)

        capture_dates = self._get_capture_dates(video_id, int_or_none(url_date))
        self.write_debug('Captures to try: ' + join_nonempty(*capture_dates, delim=', '))
        info = {'id': video_id}
        for capture in capture_dates:
            webpage = self._download_webpage(
                (self._WAYBACK_BASE_URL + 'http://www.youtube.com/watch?v=%s') % (capture, video_id),
                video_id=video_id, fatal=False, errnote='unable to download capture webpage (it may not be archived)',
                note='Downloading capture webpage')
            current_info = self._extract_metadata(video_id, webpage or '')
            # Try avoid getting deleted video metadata
            if current_info.get('title'):
                info = merge_dicts(info, current_info)
                if 'captures' not in self._configuration_arg('check_all'):
                    break

        info['thumbnails'] = self._extract_thumbnails(video_id)

        if urlh:
            url = compat_urllib_parse_unquote(urlh.geturl())
            video_file_url_qs = parse_qs(url)
            # Attempt to recover any ext & format info from playback url & response headers
            format = {'url': url, 'filesize': int_or_none(urlh.headers.get('x-archive-orig-content-length'))}