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

Code before:
            'series': try_get(content, lambda x: x['Media']['Name']),
            'tags': tags,
            'categories': categories,
            'duration': float_or_none(content_package.get('Duration')),
            'formats': formats,
            'thumbnails': thumbnails,
        }

        if content_package.get('HasClosedCaptions'):
            info['subtitles'] = {
                'en': [{
                    'url': manifest_base_url + 'vtt',
                    'ext': 'vtt',
                }, {
                    'url': manifest_base_url + 'srt',
                    'ext': 'srt',
                }]
            }

        return info


class CPTwentyFourIE(InfoExtractor):
    IE_NAME = 'cp24'
    _GEO_COUNTRIES = ['CA']
    _VALID_URL = r'https?://(?:www\.)?cp24\.com/news/.*'

    _TESTS = [{
        'url': 'https://www.cp24.com/news/video-shows-atm-being-ripped-out-of-business-by-pickup-truck-driver-in-mississauga-1.5676877',
        'info_dict': {
            'id': '2328005',
            'ext': 'mp4',
            'title': 'WATCH: Truck rips ATM from Mississauga business',
            'description': 'md5:cf7498480885f080a754389a2b2f7073',
            'timestamp': 1637618377,
            'episode_number': None,
            'season': 'Season 0',
            'season_number': 0,
            'season_id': 57974,
            'series': 'CTV News Toronto',
            'duration': 26.86,
            'thumbnail': 'http://images2.9c9media.com/image_asset/2014_11_5_2eb609a0-475b-0132-fbd6-34b52f6f1279_jpg_2000x1125.jpg',
            'duration_string': '26',
            'upload_date': '20211122',
        },
        'params': {'skip_download': True, 'format': 'bv'}
    }]

    def _real_extract(self, url):
        webpage = self._download_webpage(url, None)
        match_obj = re.search(r'getAuthStates\(\"(?P<id>[^\"]+)\",\s?\"(?P<destination>[^\"]+)\"\);', webpage)

Review comment (suggestion):
```suggestion
    _VALID_URL = r'https?://(?:www\.)?cp24\.com/news/(?P<id>[^?#]+)'
```
and use this id for the webpage download message
and maybe also return as `display_id`

Code after:
            'categories': categories,
            'duration': float_or_none(content_package.get('Duration')),
            'formats': formats,
            'thumbnails': thumbnails,
        }

        if content_package.get('HasClosedCaptions'):
            info['subtitles'] = {
                'en': [{
                    'url': manifest_base_url + 'vtt',
                    'ext': 'vtt',
                }, {
                    'url': manifest_base_url + 'srt',
                    'ext': 'srt',
                }]
            }

        return info


class CPTwentyFourIE(InfoExtractor):
    IE_NAME = 'cp24'
    _GEO_COUNTRIES = ['CA']
    _VALID_URL = r'https?://(?:www\.)?cp24\.com/news/(?P<id>[^?#]+)'

    _TESTS = [{
        'url': 'https://www.cp24.com/news/video-shows-atm-being-ripped-out-of-business-by-pickup-truck-driver-in-mississauga-1.5676877',
        'info_dict': {
            'id': '2328005',
            'ext': 'mp4',
            'title': 'WATCH: Truck rips ATM from Mississauga business',
            'description': 'md5:cf7498480885f080a754389a2b2f7073',
            'timestamp': 1637618377,
            'episode_number': None,
            'season': 'Season 0',
            'season_number': 0,
            'season_id': 57974,
            'series': 'CTV News Toronto',
            'duration': 26.86,
            'thumbnail': 'http://images2.9c9media.com/image_asset/2014_11_5_2eb609a0-475b-0132-fbd6-34b52f6f1279_jpg_2000x1125.jpg',
            'upload_date': '20211122',
        },
        'params': {'skip_download': True, 'format': 'bv'}
    }]

    def _real_extract(self, url):
        display_id = self._match_id(url)
        webpage = self._download_webpage(url, display_id)
        id, destination = self._search_regex(
            r'getAuthStates\("(?P<id>[^"]+)",\s?"(?P<destination>[^"]+)"\);',
            webpage, 'video id and destination', group=('id', 'destination'))