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

Code before:
            self._merge_subtitles(subs, target=subtitles)
        if caption_url := traverse_obj(video_data, ('captionPath', {url_or_none})):
            subtitles.setdefault('en', []).append({'url': caption_url, 'ext': 'vtt'})

        return {
            'id': video_id,
            'display_id': display_id,
            'formats': formats,
            'subtitles': subtitles,
            'title': self._get_title(webpage),
            'description': self._get_description(webpage),
            **traverse_obj(video_data, {
                'title': ('title', {str}),
                'description': ('description', {clean_html}),
                'categories': ('categories', ..., {str}),
                'thumbnail': ('videoThumbnail', {url_or_none}),
                'timestamp': ('startDateTime', {unified_timestamp}),
                'location': ('locationName', {str}),
                'is_live': ('eventStatus', {lambda x: x == 'live'}),
            }),
        }


class TvwNewsIE(TvwBaseIE):
    IE_NAME = 'Tvw:News'
    _VALID_URL = r'https?://(?:www\.)?tvw\.org/(\d{4})/(0[1-9]|1[0-2])/(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://tvw.org/2024/01/the-impact-issues-to-watch-in-the-2024-legislative-session/',
        'info_dict': {
            'id': 'the-impact-issues-to-watch-in-the-2024-legislative-session',
            'title': 'The Impact - Issues to Watch in the 2024 Legislative Session',
            'description': 'md5:65f0b33ec8f18ff1cd401c5547aa5441',
        },
        'playlist_count': 6,
    }, {
        'url': 'https://tvw.org/2024/06/the-impact-water-rights-and-the-skookumchuck-dam-debate/',
        'info_dict': {
            'id': 'the-impact-water-rights-and-the-skookumchuck-dam-debate',
            'title': 'The Impact - Water Rights and the Skookumchuck Dam Debate',
            'description': 'md5:185f3a2350ef81e3fa159ac3e040a94b',
        },
        'playlist_count': 1,
    }, {
        'url': 'https://tvw.org/2023/09/5th-annual-tvw-open-thank-you/',
        'info_dict': {
            'id': '5th-annual-tvw-open-thank-you',
            'title': '5th Annual TVW Open THANK YOU!',
            'description': 'md5:5306eef5b03c87108797cb6261c5f16c',
        },
        'playlist_count': 0,
    }]

Review comment (suggestion):
IMO we can trust that they won't use fake month numerals... and if they do, who cares?
```suggestion
    _VALID_URL = r'https?://(?:www\.)?tvw\.org/\d{4}/\d{2}/(?P<id>[^/?#]+)'
```

Code after:
            'https://api.v3.invintus.com/v2/Event/getDetailed', video_id,
            headers={
                'authorization': 'embedder',
                'wsc-api-key': '7WhiEBzijpritypp8bqcU7pfU9uicDR',
            },
            data=json.dumps({
                'clientID': client_id,
                'eventID': video_id,
                'showStreams': True,
            }).encode())['data']

        formats = []
        subtitles = {}
        for stream_url in traverse_obj(video_data, ('streamingURIs', ..., {url_or_none})):
            fmts, subs = self._extract_m3u8_formats_and_subtitles(
                stream_url, video_id, 'mp4', m3u8_id='hls', fatal=False)
            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)
        if caption_url := traverse_obj(video_data, ('captionPath', {url_or_none})):
            subtitles.setdefault('en', []).append({'url': caption_url, 'ext': 'vtt'})

        return {
            'id': video_id,
            'display_id': display_id,
            'formats': formats,
            'subtitles': subtitles,
            'title': remove_end(self._og_search_title(webpage, default=None), ' - TVW'),
            'description': self._og_search_description(webpage, default=None),
            **traverse_obj(video_data, {
                'title': ('title', {str}),
                'description': ('description', {clean_html}),
                'categories': ('categories', ..., {str}),
                'thumbnail': ('videoThumbnail', {url_or_none}),
                'timestamp': ('startDateTime', {unified_timestamp}),
                'location': ('locationName', {str}),
                'is_live': ('eventStatus', {lambda x: x == 'live'}),
            }),
        }


class TvwNewsIE(InfoExtractor):
    IE_NAME = 'tvw:news'
    _VALID_URL = r'https?://(?:www\.)?tvw\.org/\d{4}/\d{2}/(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://tvw.org/2024/01/the-impact-issues-to-watch-in-the-2024-legislative-session/',
        'info_dict': {
            'id': 'the-impact-issues-to-watch-in-the-2024-legislative-session',
            'title': 'The Impact - Issues to Watch in the 2024 Legislative Session',
            'description': 'md5:65f0b33ec8f18ff1cd401c5547aa5441',
        },
        'playlist_count': 6,