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

Code before:
        # WBM captures seem to all switch to this layout ~July 2020
        modern_captures = [x for x in all_captures if x >= 20200701000000]
        if modern_captures:
            capture_dates.append(modern_captures[0])
        capture_dates.append(url_date)
        if all_captures:
            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

        video_info = self._download_json(
            'https://web.archive.org/__wb/videoinfo', video_id,
            query={'vtype': 'youtube', 'vid': video_id})

        if not traverse_obj(video_info, 'formats'):
            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)

        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)

        formats = []
        for fmt in traverse_obj(video_info, ('formats', ...)):
            format_id = traverse_obj(fmt, ('url', {parse_qs}, 'itag', 0))
            formats.append({
                'format_id': format_id,
                **self._formats.get(format_id, {}),
                **traverse_obj(fmt, {

Review comment (suggestion):
```suggestion
                'The requested video is not archived or indexed', expected=True)
```

Code after:
        # WBM captures seem to all switch to this layout ~July 2020
        modern_captures = [x for x in all_captures if x >= 20200701000000]
        if modern_captures:
            capture_dates.append(modern_captures[0])
        capture_dates.append(url_date)
        if all_captures:
            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

        video_info = self._download_json(
            'https://web.archive.org/__wb/videoinfo', video_id,
            query={'vtype': 'youtube', 'vid': video_id})

        if not traverse_obj(video_info, 'formats'):
            self.raise_no_formats(
                'The requested video is not archived or indexed', expected=True)

        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)

        formats = []
        for fmt in traverse_obj(video_info, ('formats', lambda _, v: url_or_none(v['url']))):
            format_id = traverse_obj(fmt, ('url', {parse_qs}, 'itag', 0))
            formats.append({
                'format_id': format_id,
                **self._FORMATS.get(format_id, {}),
                **traverse_obj(fmt, {