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

Code before:
                    'deviceType': 'ipad',
                    'idMedia': video_stream_id,
                    'multibitrate': 'true',
                    'output': 'json',
                    'tech': 'hls',
                    'manifestType': 'desktop',
                })
            formats = self._extract_m3u8_formats(
                stream_data['url'], video_id, 'mp4', live=live_status == 'is_live')

        return {
            'id': video_id,
            'formats': formats,
            'live_status': live_status,
            'release_timestamp': release_timestamp,
            **traverse_obj(video_info, {
                'title': ('title', {str}),
                'description': ('description', {str}),
                'thumbnail': ('images', 'card', 'url'),
            }),
        }


class CBCListenIE(InfoExtractor):
    IE_NAME = 'cbc.ca:listen'
    _VALID_URL = r'https?://(?:www\.)?cbc\.ca/(:?listen/)(?:cbc-podcasts|live-radio)/(?:[^/]+/)+(?P<id>\d+)'
    _TESTS = [{
        'url': 'https://www.cbc.ca/listen/cbc-podcasts/1353-the-naked-emperor/episode/16142603-introducing-understood-who-broke-the-internet',
        'info_dict': {
            'id': '16142603',
            'title': 'Introducing Understood: Who Broke the Internet?',
            'ext': 'mp3',
            'description': 'md5:c605117500084e43f08a950adc6a708c',
            'duration': 229,
            'timestamp': 1745827200000,
        },
    }, {
        'url': 'https://www.cbc.ca/listen/live-radio/1-64-the-house/clip/16170773-should-canada-suck-stand-donald-trump',
        'info_dict': {
            'id': '16170773',
            'title': 'Should Canada suck up or stand up to Donald Trump?',
            'ext': 'mp3',
            'description': 'md5:7385194f1cdda8df27ba3764b35e7976',
            'duration': 3159,
            'timestamp': 1758254400000,
        },
    }]

    def _download_api_json(self, video_id):
        api_url = f'https://www.cbc.ca/listen/api/v1/clips/{video_id}'
        raw = self._download_webpage(api_url, video_id,

Review comment (suggestion):
Seems like a pretty broad match. Any reason not to use this?
```suggestion
    _VALID_URL = r'https?://(?:www\.)?cbc\.ca/listen/(?:cbc-podcasts|live-radio)/[\w-]+/[\w-]+/(?P<id>\d+)'
```

Code after:
                })
            formats = self._extract_m3u8_formats(
                stream_data['url'], video_id, 'mp4', live=live_status == 'is_live')

        return {
            'id': video_id,
            'formats': formats,
            'live_status': live_status,
            'release_timestamp': release_timestamp,
            **traverse_obj(video_info, {
                'title': ('title', {str}),
                'description': ('description', {str}),
                'thumbnail': ('images', 'card', 'url'),
            }),
        }


class CBCListenIE(InfoExtractor):
    IE_NAME = 'cbc.ca:listen'
    _VALID_URL = r'https?://(?:www\.)?cbc\.ca/listen/(?:cbc-podcasts|live-radio)/[\w-]+/[\w-]+/(?P<id>\d+)'
    _TESTS = [{
        'url': 'https://www.cbc.ca/listen/cbc-podcasts/1353-the-naked-emperor/episode/16142603-introducing-understood-who-broke-the-internet',
        'info_dict': {
            'id': '16142603',
            'title': 'Introducing Understood: Who Broke the Internet?',
            'ext': 'mp3',
            'description': 'md5:c605117500084e43f08a950adc6a708c',
            'duration': 229,
            'timestamp': 1745812800,
            'release_timestamp': 1745827200,
            'release_date': '20250428',
            'upload_date': '20250428',
        },
    }, {
        'url': 'https://www.cbc.ca/listen/live-radio/1-64-the-house/clip/16170773-should-canada-suck-stand-donald-trump',
        'info_dict': {
            'id': '16170773',
            'title': 'Should Canada suck up or stand up to Donald Trump?',
            'ext': 'mp3',
            'description': 'md5:7385194f1cdda8df27ba3764b35e7976',
            'duration': 3159,
            'timestamp': 1758340800,
            'release_timestamp': 1758254400,
            'release_date': '20250919',
            'upload_date': '20250920',
        },
    }]

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