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

Code before:
        common_entry = {
            'uploader': uploader,
            'uploader_id': uploader_id,
            'thumbnail': thumbnail,
        }

        info = common_entry.copy()
        info.update({
            'id': video_id,
            'title': title,
            'duration': duration,
        })

        if not video_url:
            entries = []
            file_elements = video_element.findall(compat_xpath('./file'))
            one = len(file_elements) == 1
            for file_num, file_element in enumerate(file_elements, start=1):
                file_url = url_or_none(file_element.text)
                if not file_url:
                    continue
                key = file_element.get('key', '')
                upload_date = self._search_regex(
                    r'^(\d{8})_', key, 'upload date', default=None)
                if upload_date is not None:
                    try:
                        # sometimes the upload date isn't included in the file name
                        # instead, another random ID is, which may not parse as a date
                        # or may be wildly out of a reasonable range
                        parsed_date = date_from_str(upload_date)
                        if parsed_date.year < 2000 or parsed_date.year >= 2100:
                            upload_date = None
                    except ValueError:
                        upload_date = None
                file_duration = int_or_none(file_element.get('duration'))
                format_id = key if key else '%s_%s' % (video_id, file_num)
                if determine_ext(file_url) == 'm3u8':
                    formats = self._extract_m3u8_formats(
                        file_url, video_id, 'mp4', entry_protocol='m3u8_native',
                        m3u8_id='hls',
                        note='Downloading part %d m3u8 information' % file_num)
                else:
                    formats = [{
                        'url': file_url,
                        'format_id': 'http',
                    }]
                if not formats and not self.get_param('ignore_no_formats'):
                    continue
                self._sort_formats(formats)
                file_info = common_entry.copy()
                file_info.update({

Review comment (suggestion):
The parsed upload date should simply be passed through `unified_strdate` which would avoid this issue. You can still keep the sanity check on year if needed

Code after:

        common_entry = {
            'uploader': uploader,
            'uploader_id': uploader_id,
            'thumbnail': thumbnail,
        }

        info = common_entry.copy()
        info.update({
            'id': video_id,
            'title': title,
            'duration': duration,
        })

        if not video_url:
            entries = []
            file_elements = video_element.findall(compat_xpath('./file'))
            one = len(file_elements) == 1
            for file_num, file_element in enumerate(file_elements, start=1):
                file_url = url_or_none(file_element.text)
                if not file_url:
                    continue
                key = file_element.get('key', '')
                upload_date = unified_strdate(self._search_regex(
                    r'^(\d{8})_', key, 'upload date', default=None))
                if upload_date is not None:
                    # sometimes the upload date isn't included in the file name
                    # instead, another random ID is, which may parse as a valid
                    # date but be wildly out of a reasonable range
                    parsed_date = date_from_str(upload_date)
                    if parsed_date.year < 2000 or parsed_date.year >= 2100:
                        upload_date = None
                file_duration = int_or_none(file_element.get('duration'))
                format_id = key if key else '%s_%s' % (video_id, file_num)
                if determine_ext(file_url) == 'm3u8':
                    formats = self._extract_m3u8_formats(
                        file_url, video_id, 'mp4', entry_protocol='m3u8_native',
                        m3u8_id='hls',
                        note='Downloading part %d m3u8 information' % file_num)
                else:
                    formats = [{
                        'url': file_url,
                        'format_id': 'http',
                    }]
                if not formats and not self.get_param('ignore_no_formats'):
                    continue
                self._sort_formats(formats)
                file_info = common_entry.copy()
                file_info.update({
                    'id': format_id,
                    'title': title if one else '%s (part %d)' % (title, file_num),