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

Code before:
        caption_url = traverse_obj(details, ('vod', 'source', 'subtitle', {url_or_none}))
        subtitles = {'ko': [{'url': caption_url}]} if caption_url else None

        return {
            'id': video_id,
            **traverse_obj(details, ('vod', {
                'title': ('info', 'title'),
                'duration': ('info', 'duration', {int_or_none}),
                'view_count': ('info', 'viewcount', {int_or_none}),
                'like_count': ('info', 'likecount', {int_or_none}),
                'description': ('info', 'synopsis', {clean_html}),
                'episode': ('info', 'content', ('contenttitle', 'title')),
                'episode_number': ('info', 'content', 'number', {int_or_none}),
                'series': ('info', 'program', 'programtitle'),
                'age_limit': ('info', 'targetage', {int_or_none}),
                'release_timestamp': ('info', 'broaddate', {parse_iso8601}),
                'thumbnail': ('source', 'thumbnail', 'origin', {url_or_none}),
            }), get_all=False),
            'formats': formats,
            'subtitles': subtitles,
        }


class SBSCoKrAllvodProgramIE(InfoExtractor):
    IE_NAME = 'sbs.co.kr:allvod_program'
    _VALID_URL = r'https?://allvod\.sbs\.co\.kr/allvod/vod(?:Free)?ProgramDetail\.do\?(?:[^#]+&)?pgmId=(?P<id>P?[0-9]+)'

    _TESTS = [{
        'url': 'https://allvod.sbs.co.kr/allvod/vodFreeProgramDetail.do?type=legend&pgmId=22000010159&listOrder=vodCntAsc',
        'info_dict': {
            '_type': 'playlist',
            'id': '22000010159',
        },
        'playlist_count': 18,
    }, {
        'url': 'https://allvod.sbs.co.kr/allvod/vodProgramDetail.do?pgmId=P460810577',
        'info_dict': {
            '_type': 'playlist',
            'id': 'P460810577',
        },
        'playlist_count': 13,
    }]

    def _real_extract(self, url):
        program_id = self._match_id(url)

        details = self._download_json(
            'https://allvod.sbs.co.kr/allvod/vodProgramDetail/vodProgramDetailAjax.do',
            program_id, note='Downloading program details',
            query={
                'pgmId': program_id,

Review comment (suggestion):
```suggestion
    _VALID_URL = r'https?://allvod\.sbs\.co\.kr/allvod/vod(?:Free)?ProgramDetail\.do\?(?:[^#]+&)?pgmId=(?P<id>P?\d+)'
```

Code after:
                'preference': int_or_none(stream.get('mediarscuse'))
            })

        caption_url = traverse_obj(details, ('vod', 'source', 'subtitle', {url_or_none}))

        return {
            'id': video_id,
            **traverse_obj(details, ('vod', {
                'title': ('info', 'title'),
                'duration': ('info', 'duration', {int_or_none}),
                'view_count': ('info', 'viewcount', {int_or_none}),
                'like_count': ('info', 'likecount', {int_or_none}),
                'description': ('info', 'synopsis', {clean_html}),
                'episode': ('info', 'content', ('contenttitle', 'title')),
                'episode_number': ('info', 'content', 'number', {int_or_none}),
                'series': ('info', 'program', 'programtitle'),
                'age_limit': ('info', 'targetage', {int_or_none}),
                'release_timestamp': ('info', 'broaddate', {parse_iso8601}),
                'thumbnail': ('source', 'thumbnail', 'origin', {url_or_none}),
            }), get_all=False),
            'formats': formats,
            'subtitles': {'ko': [{'url': caption_url}]} if caption_url else None,
        }


class SBSCoKrAllvodProgramIE(InfoExtractor):
    IE_NAME = 'sbs.co.kr:allvod_program'
    _VALID_URL = r'https?://allvod\.sbs\.co\.kr/allvod/vod(?:Free)?ProgramDetail\.do\?(?:[^#]+&)?pgmId=(?P<id>P?\d+)'

    _TESTS = [{
        'url': 'https://allvod.sbs.co.kr/allvod/vodFreeProgramDetail.do?type=legend&pgmId=22000010159&listOrder=vodCntAsc',
        'info_dict': {
            '_type': 'playlist',
            'id': '22000010159',
        },
        'playlist_count': 18,
    }, {
        'url': 'https://allvod.sbs.co.kr/allvod/vodProgramDetail.do?pgmId=P460810577',
        'info_dict': {
            '_type': 'playlist',
            'id': 'P460810577',
        },
        'playlist_count': 13,
    }]

    def _real_extract(self, url):
        program_id = self._match_id(url)

        details = self._download_json(
            'https://allvod.sbs.co.kr/allvod/vodProgramDetail/vodProgramDetailAjax.do',
            program_id, note='Downloading program details',