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

Code before:
            'info_dict': {
                'id': '3024',
                'ext': 'mp4',
                'title': 'Olivier Messiaen and Yvonne Loriod, pianists and teachers',
                'thumbnail': r're:^https?://medicitv-[abc]\.imgix\.net/movie/[^?]+\.jpg(?:\?[^?]+)?',
                'description': 'md5:aab948e2f7690214b5c28896c83f1fc1',
                'upload_date': '20150223',
            },
        },
        {
            'url': 'https://www.medici.tv/en/jazz/makaya-mccraven-la-rochelle',
            'md5': '4cc279a8b06609782747c8f50beea2b3',
            'expected_warnings': [r'preview'],
            'info_dict': {
                'id': '7922',
                'ext': 'mp4',
                'title': 'NEW: Makaya McCraven in La Rochelle',
                'thumbnail': r're:^https?://medicitv-[abc]\.imgix\.net/movie/[^?]+\.jpg(?:\?[^?]+)?',
                'description': 'md5:b5a8aaeb6993d8ccb18bde8abb8aa8d2',
                'upload_date': '20231228',
            },
        },
    ]

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

        self._download_webpage(url, video_id)
        cookies = self._get_cookies(url)

        if 'edu' in url:
            request_url = f'https://api.medici.tv/edu-satie/edito/movie-file/{video_id}/'
            source_url = 'https://edu.medici.tv'
        else:
            request_url = f'https://api.medici.tv/satie/edito/movie-file/{video_id}/'
            source_url = 'https://www.medici.tv'

        mAuth_cookie = cookies.get('auth._token.mAuth')
        if not mAuth_cookie:
            token = ''
        else:
            token = unquote(str_or_none(mAuth_cookie.value, ''))

        data = self._download_json(
            request_url, video_id,
            headers={
                'Authorization': token,
                'Device-Type': 'web',
                'Origin': source_url,
                'Referer': source_url + '/',
                'Accept': 'application/json, text/plain, */*',

Review comment (suggestion):
```suggestion
        video_id, subdomain = self._match_valid_url(url).group('id', 'sub')
```

Code after:
        },
        'expected_warnings': [r'preview'],
    }, {
        'url': 'https://edu.medici.tv/en/masterclasses/yvonne-loriod-olivier-messiaen',
        'md5': 'fb5dcec46d76ad20fbdbaabb01da191d',
        'info_dict': {
            'id': '3024',
            'ext': 'mp4',
            'title': 'Olivier Messiaen and Yvonne Loriod, pianists and teachers',
            'thumbnail': r're:https://.+/.+\.jpg',
            'description': 'md5:aab948e2f7690214b5c28896c83f1fc1',
            'upload_date': '20150223',
            'timestamp': 1424706608,
            'display_id': 'yvonne-loriod-olivier-messiaen',
        },
        'skip': 'Requires authentication; preview starts in the middle',
    }, {
        'url': 'https://www.medici.tv/en/jazz/makaya-mccraven-la-rochelle',
        'md5': '4cc279a8b06609782747c8f50beea2b3',
        'info_dict': {
            'id': '7922',
            'ext': 'mp4',
            'title': 'NEW: Makaya McCraven in La Rochelle',
            'thumbnail': r're:https://.+/.+\.jpg',
            'description': 'md5:b5a8aaeb6993d8ccb18bde8abb8aa8d2',
            'upload_date': '20231228',
            'timestamp': 1703754863,
            'display_id': 'makaya-mccraven-la-rochelle',
        },
        'expected_warnings': [r'preview'],
    }]

    def _real_extract(self, url):
        display_id, subdomain = self._match_valid_url(url).group('id', 'sub')
        self._request_webpage(url, display_id, 'Requesting CSRF token cookie')

        subdomain = 'edu-' if subdomain == 'edu' else ''
        origin = f'https://{urllib.parse.urlparse(url).hostname}'

        data = self._download_json(
            f'https://api.medici.tv/{subdomain}satie/edito/movie-file/{display_id}/', display_id,
            headers=filter_dict({
                'Authorization': try_call(
                    lambda: urllib.parse.unquote(self._get_cookies(url)['auth._token.mAuth'].value)),
                'Device-Type': 'web',
                'Origin': origin,
                'Referer': f'{origin}/',
                'Accept': 'application/json, text/plain, */*',
            }))

        if not traverse_obj(data, ('video', 'is_full_video')) and traverse_obj(