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

Code before:
            subtitles.setdefault(sub.get('label', 'und'), []).append({'url': sub.get('file')})

        formats = []
        for format_id, stream in traverse_obj(playback_data, ('sources', 'HLS'), default={}).items():
            m3u8_url = re.sub(r'/playlist(?:_pd180000)?\.m3u8', '/index.m3u8', stream.get('file'))
            formats.extend(self._extract_m3u8_formats(m3u8_url, video_id, m3u8_id=format_id))

        return {
            'id': video_id,
            **traverse_obj(metadata, ('vodDetail', {
                'title': 'vodTitleView',
                'series': 'programTitle',
                'age_limit': 'watchAge',
                'release_date': ('broadcastDate', {lambda x: re.match(r'\d{8}', x.replace('.', ''))}, 0),
                'description': 'episodeContents',
                'thumbnail': 'imgFileUrl',
            })),
            'duration': parse_duration(playback_data.get('playTime')),
            'formats': formats,
            'subtitles': subtitles,
        }


class JTBCProgramIE(InfoExtractor):
    IE_NAME = 'JTBC:program'
    _VALID_URL = r'https?://(?:vod\.jtbc\.co\.kr/program|tv\.jtbc\.co\.kr/replay)/(?P<id>pr[0-9]+)/(?:replay|pm[0-9]+)$'

    _TESTS = [{
        'url': 'https://tv.jtbc.co.kr/replay/pr10010392/pm10032710',
        'info_dict': {
            '_type': 'playlist',
            'id': 'pr10010392',
        },
        'playlist_count': 398,
    }, {
        'url': 'https://vod.jtbc.co.kr/program/pr10011491/replay',
        'info_dict': {
            '_type': 'playlist',
            'id': 'pr10011491',
        },
        'playlist_count': 59,
    }]

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

        vod_list = self._download_json(
            f'https://now-api.jtbc.co.kr/v1/vodClip/programHome/programReplayVodList?programId={program_id}&rowCount=10000',
            program_id, note='Downloading program replay list')

        entries = [self.url_result(

Review comment (suggestion):
allow trailing slash/query/fragment
```suggestion
    _VALID_URL = r'https?://(?:vod\.jtbc\.co\.kr/program|tv\.jtbc\.co\.kr/replay)/(?P<id>pr\d+)/(?:replay|pm\d+)/?(?:$|[?#])'
```

Code after:
        else:
            webpage = self._download_webpage(url, display_id)
            video_id = self._search_regex(r'data-vod="(VO\d+)"', webpage, 'vod id')

        playback_data = self._download_json(
            f'https://api.jtbc.co.kr/vod/{video_id}', video_id, note='Downloading VOD playback data')

        subtitles = {}
        for sub in traverse_obj(playback_data, ('tracks', lambda _, v: v['file'])):
            subtitles.setdefault(sub.get('label', 'und'), []).append({'url': sub['file']})

        formats = []
        for stream_url in traverse_obj(playback_data, ('sources', 'HLS', ..., 'file', {url_or_none})):
            stream_url = re.sub(r'/playlist(?:_pd\d+)?\.m3u8', '/index.m3u8', stream_url)
            formats.extend(self._extract_m3u8_formats(stream_url, video_id, fatal=False))

        metadata = self._download_json(
            'https://now-api.jtbc.co.kr/v1/vod/detail', video_id,
            note='Downloading mobile details', fatal=False, query={'vodFileId': video_id})
        return {
            'id': video_id,
            'display_id': display_id,
            **traverse_obj(metadata, ('vodDetail', {
                'title': 'vodTitleView',
                'series': 'programTitle',
                'age_limit': ('watchAge', {int_or_none}),
                'release_date': ('broadcastDate', {lambda x: re.match(r'\d{8}', x.replace('.', ''))}, 0),
                'description': 'episodeContents',
                'thumbnail': ('imgFileUrl', {url_or_none}),
            })),
            'duration': parse_duration(playback_data.get('playTime')),
            'formats': formats,
            'subtitles': subtitles,
        }


class JTBCProgramIE(InfoExtractor):
    IE_NAME = 'JTBC:program'
    _VALID_URL = r'https?://(?:vod\.jtbc\.co\.kr/program|tv\.jtbc\.co\.kr/replay)/(?P<id>pr\d+)/(?:replay|pm\d+)/?(?:$|[?#])'

    _TESTS = [{
        'url': 'https://tv.jtbc.co.kr/replay/pr10010392/pm10032710',
        'info_dict': {
            '_type': 'playlist',
            'id': 'pr10010392',
        },
        'playlist_count': 398,
    }, {
        'url': 'https://vod.jtbc.co.kr/program/pr10011491/replay',
        'info_dict': {
            '_type': 'playlist',