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

Code before:

        for href, resolution in re.findall(
                r'<a[^>]+data-quality="[^"]+"[^>]+href="([^"]+)"[^>]+class="quality-btn"[^>]*>([0-9]+p)',
                webpage):
            if need_confirm_age:
                handler = self._download_age_confirm_page
            else:
                handler = self._download_webpage

            webpage = handler(
                urljoin(self._BASE_URL, href), video_id,
                f'Downloading {resolution} version information', fatal=False)
            if not webpage:
                # Manually report warning because empty page is returned when
                # invalid version is requested.
                self.report_warning(f'Unable to download {resolution} version information')
                continue

            extract_format(webpage, resolution)

        return merge_dicts(info_dict, info)


class CDAFolderIE(InfoExtractor):
    _MAX_PAGE_NUMBER = 200
    _VALID_URL = r'https?://(?:www\.)?cda\.pl/[0-9a-zA-Z_]+/folder/(?P<id>[0-9a-z]+)(/vfilm)?'
    _TESTS = [
        {
            'url': 'https://www.cda.pl/domino264/folder/31188385',
            'info_dict': {
                'id': '31188385',
                'title': 'SERIA DRUGA',
            },
            'playlist_count': 13,
        },
        {
            'url': 'https://www.cda.pl/smiechawaTV/folder/2664592/vfilm',
            'info_dict': {
                'id': '2664592',
                'title': 'VideoDowcipy - wszystkie odcinki',
            },
            'playlist_count': 71,
        },
        {
            'url': 'https://www.cda.pl/DeliciousBeauty/folder/19129979/vfilm',
            'info_dict': {
                'id': '19129979',
                'title': 'TESTY KOSMETYKÓW',
            },
            'playlist_count': 139,
        }]

Review comment (suggestion):
Do you have any example URLs where the ID contains letters?
If no, we can use:
```suggestion
    _VALID_URL = r'https?://(?:www\.)?cda\.pl/\w+/folder/(?P<id>\d+)'
```

Code after:
        extract_format(webpage, 'default')

        for href, resolution in re.findall(
                r'<a[^>]+data-quality="[^"]+"[^>]+href="([^"]+)"[^>]+class="quality-btn"[^>]*>([0-9]+p)',
                webpage):
            if need_confirm_age:
                handler = self._download_age_confirm_page
            else:
                handler = self._download_webpage

            webpage = handler(
                urljoin(self._BASE_URL, href), video_id,
                f'Downloading {resolution} version information', fatal=False)
            if not webpage:
                # Manually report warning because empty page is returned when
                # invalid version is requested.
                self.report_warning(f'Unable to download {resolution} version information')
                continue

            extract_format(webpage, resolution)

        return merge_dicts(info_dict, info)


class CDAFolderIE(InfoExtractor):
    _MAX_PAGE_SIZE = 36
    _VALID_URL = r'https?://(?:www\.)?cda\.pl/(?P<channel>\w+)/folder/(?P<id>\d+)'
    _TESTS = [
        {
            'url': 'https://www.cda.pl/domino264/folder/31188385',
            'info_dict': {
                'id': '31188385',
                'title': 'SERIA DRUGA',
            },
            'playlist_mincount': 13,
        },
        {
            'url': 'https://www.cda.pl/smiechawaTV/folder/2664592/vfilm',
            'info_dict': {
                'id': '2664592',
                'title': 'VideoDowcipy - wszystkie odcinki',
            },
            'playlist_mincount': 71,
        },
        {
            'url': 'https://www.cda.pl/DeliciousBeauty/folder/19129979/vfilm',
            'info_dict': {
                'id': '19129979',
                'title': 'TESTY KOSMETYKÓW',
            },
            'playlist_mincount': 139,