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

Code before:
        return {
            'id': episode_id,
            'title': episode.get('title'),
            'description': episode.get('description'),
            'thumbnail': episode.get('thumbnail'),
            'formats': [
                {'url': episode[f'jwVideo{h}Embed'], 'height': h}
                for h in (320, 480, 720, 1080) if episode.get(f'jwVideo{h}Embed')
            ],
            'duration': int_or_none(episode.get('length')),
            'series': course.get('name'),
            'series_id': course.get('url'),
            'availability': self._availability(
                needs_premium=False, needs_subscription=False, needs_auth=True,
                is_private=False, is_unlisted=False),
            'chapter': chapter_name,
            'chapter_number': chapter_number,
            'chapter_id': chapter_id,
            'subtitles': {
                'en': [{'ext': 'vtt', 'data': episode['enCaptionData']}]
            } if episode.get('enCaptionData') else None,
        }


class ITProTVCourseIE(ITProTVIE):
    _VALID_URL = r'https?://app.itpro.tv/course/(?P<id>[0-9a-z-]+)'
    _TESTS = [
        {
            'url': 'https://app.itpro.tv/course/guided-tour',
            'info_dict': {
                'id': 'guided-tour',
                'description': 'md5:b175c2c3061ce35a4dd33865b2c1da4e',
                'title': 'ITProTV 101',
            },
            'playlist_count': 6,
            'params': {
                'skip_download': True,
            },
        },
        {
            'url': 'https://app.itpro.tv/course/beyond-tech',
            'info_dict': {
                'id': 'beyond-tech',
                'description': 'md5:44cd99855e7f81a15ce1269bd0621fed',
                'title': 'Beyond Tech'
            },
            'playlist_count': 15,
            'params': {
                'skip_download': True,
            },
        },

Review comment (suggestion):
```suggestion
    _VALID_URL = r'https?://app.itpro.tv/course/(?P<id>[0-9a-z-]+)/?(?:$|[#?])'
```
should fix the `test_all_urls` issue

Code after:
        }


class ITProTVCourseIE(ITProTVBaseIE):
    _VALID_URL = r'https?://app.itpro.tv/course/(?P<id>[\w-]+)/?(?:$|[#?])'
    _TESTS = [
        {
            'url': 'https://app.itpro.tv/course/guided-tour',
            'info_dict': {
                'id': 'guided-tour',
                'description': 'md5:b175c2c3061ce35a4dd33865b2c1da4e',
                'title': 'ITProTV 101',
            },
            'playlist_count': 6
        },
        {
            'url': 'https://app.itpro.tv/course/beyond-tech',
            'info_dict': {
                'id': 'beyond-tech',
                'description': 'md5:44cd99855e7f81a15ce1269bd0621fed',
                'title': 'Beyond Tech'
            },
            'playlist_count': 15
        },
    ]

    def _real_extract(self, url):
        course_id = self._match_id(url)
        webpage = self._download_webpage(url, course_id)
        self._check_if_logged_in(webpage)
        course = self._call_api('course', course_id, webpage)

        entries = [self.url_result(
            urljoin(url, f'{course_id}/{episode["url"]}'), ITProTVIE,
            episode['url'], episode.get('title'), url_transparent=True)
            for episode in course['episodes']]

        return self.playlist_result(
            entries, course_id, course.get('name'), course.get('description'))