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

Code before:
        headers = {
            'X-Av-Code': '23',
            'X-Country': 'IN',
            'X-Platform': 'android',
            'X-App-Version': '1370001318',
            'X-Resolution': '3840x2160',
        }
        data_json = self._download_json(f'{API_URL}{type}/{video_id}', display_id, headers=headers)['profile']

        season, series = None, None
        for dct in data_json.get('levelInfos', []):
            if dct.get('type') == 'tvshow_season':
                season = dct.get('name')
            elif dct.get('type') == 'tvshow_show':
                series = dct.get('name')
        thumbnails = []
        for thumb in data_json.get('poster', []):
            thumbnails.append({
                'url': thumb.get('url'),
                'width': thumb.get('width'),
                'height': thumb.get('height'),
            })

        formats = []
        subtitles = {}
        for dct in data_json.get('playInfo', []):
            if dct.get('extension') == 'mpd':
                frmt, subs = self._extract_mpd_formats_and_subtitles(dct.get('playUrl'), display_id, fatal=False)
                formats.extend(frmt)
                subtitles = self._merge_subtitles(subtitles, subs)
            elif dct.get('extension') == 'm3u8':
                frmt, subs = self._extract_m3u8_formats_and_subtitles(dct.get('playUrl'), display_id, fatal=False)
                formats.extend(frmt)
                subtitles = self._merge_subtitles(subtitles, subs)
        self._sort_formats(formats)
        return {
            'id': video_id,
            'display_id': display_id,
            'title': data_json.get('name') or display_id,
            'description': data_json.get('description'),
            'season_number': data_json.get('seasonNum'),
            'episode_number': data_json.get('episodeNum'),
            'duration': data_json.get('duration'),
            'season': season,
            'series': series,
            'thumbnails': thumbnails,
            'formats': formats,
            'subtitles': subtitles,
        }



Review comment (suggestion):
use `group` instead `groups`
```suggestion
        video_type, display_id, video_id = self._match_valid_url(url).group('type', 'display_id', 'id')
```

Code after:
            'format': 'bv',
            'skip_download': True,
        },
    }, {
        'url': 'https://www.mxplayer.in/show/watch-ek-thi-begum-hindi/season-2/game-of-power-online-5e5305c28f1409847cdc4520b6ad77cf',
        'info_dict': {
            'id': '5e5305c28f1409847cdc4520b6ad77cf',
            'display_id': 'game-of-power-online',
            'title': 'Game Of Power',
            'duration': 1845,
            'ext': 'mp4',
            'description': 'md5:1d0948d2a5312d7013792d53542407f9',
            'series': 'Ek Thi Begum (Hindi)',
            'season': 'Season 2',
            'season_number': 2,
            'episode': 'Episode 2',
            'episode_number': 2,
        },
        'params': {
            'format': 'bv',
            'skip_download': True,
        },
    }]

    def _real_extract(self, url):
        video_type, display_id, video_id = self._match_valid_url(url).group('type', 'display_id', 'id')
        if 'show' in video_type:
            video_type = 'episode'

        data_json = self._download_json(
            f'https://api.mxplay.com/v1/web/detail/video?type={video_type}&id={video_id}', display_id)

        streams = traverse_obj(data_json, ('stream', {'m3u8': ('hls', 'high'), 'mpd': ('dash', 'high')}))
        formats, dash_subs = self._extract_mpd_formats_and_subtitles(
            f'https://llvod.mxplay.com/{streams["mpd"]}', display_id, fatal=False)
        hls_frmts, hls_subs = self._extract_m3u8_formats_and_subtitles(
            f'https://llvod.mxplay.com/{streams["m3u8"]}', display_id, fatal=False)

        formats.extend(hls_frmts)
        self._sort_formats(formats)

        season = traverse_obj(data_json, ('container', 'title'))
        return {
            'id': video_id,
            'title': data_json.get('title'),
            'formats': formats,
            'subtitles': self._merge_subtitles(dash_subs, hls_subs),
            'display_id': display_id,
            'duration': data_json.get('duration'),
            'series': traverse_obj(data_json, ('container', 'container', 'title')),
            'description': data_json.get('description'),