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

Code before:
            'display_id': 'game-of-power-online',
            'title': 'Game Of Power',
            'duration': 1845,
            'ext': 'mp4',
            'description': 'Cops arrest Ashraf assuming a prostitute. But she gets away with her new identity, Leela Paswan. Maqsood dumps Nana Mhatre and appoints Shaqeel Ansari as a new Bombay chief. For society, he is a sophisticated businessman. The rift between the new chief minister, Yashwant Patil and Shaqeel Ansari begins with a failed business deal. Ashwin Surve, a daredevil young gangster challenges established gangs of Maqsood & Bhai Chavan. He wants to enter in the drug business. But the only supplier Nari Khan supplies stuff only to Maqsood gang and no one else. ACP Qureshi arrests Bhai Chavan and turns his focus on people close to Zaheer and Ashraf. Ashraf faces a narrow escape from Qureshi and decides to take up her new identity beyond just fake documents.',
            '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).groups()

        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
        )

        formats = []
        subtitles = {}
        series, season, season_number, episode_number = None, None, None, None

        if video_type == 'episode':
            series = traverse_obj(data_json, ('container', 'container', 'title'))
            season = traverse_obj(data_json, ('container', 'title'))
            episode_number = data_json.get('sequence')
            season_number = int(self._search_regex(r'Season (\d+)', season, 'Season Number'))

        for stream_type in 'dash', 'hls':
            playlist_url = 'https://llvod.mxplay.com/{}'.format(data_json['stream'][stream_type]['high'])

            if stream_type == 'dash':
                frmts, subs = self._extract_mpd_formats_and_subtitles(playlist_url, display_id, fatal=False)
            else:
                frmts, subs = self._extract_m3u8_formats_and_subtitles(playlist_url, display_id, fatal=False)

            formats.extend(frmts)
            self._merge_subtitles(subs, target=subtitles)

        self._sort_formats(formats)

        return {

Review comment (suggestion):
Avoid trailing parentheses

```python
 data_json = self._download_json(
            f'https://api.mxplay.com/v1/web/detail/video?type={video_type}&id={video_id}', display_id)
```

Code after:
            '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'),
            'season': season,
            'season_number': int_or_none(
                self._search_regex(r'Season (\d+)', season, 'Season Number', default=None)),
            'episode_number': data_json.get('sequence') or None,
        }


class MxplayerShowIE(InfoExtractor):
    _VALID_URL = r'https?://(?:www\.)?mxplayer\.in/show/(?P<display_id>[-\w]+)-(?P<id>\w+)/?(?:$|[#?])'
    _TESTS = [{
        'url': 'https://www.mxplayer.in/show/watch-chakravartin-ashoka-samrat-series-online-a8f44e3cc0814b5601d17772cedf5417',
        'playlist_mincount': 440,
        'info_dict': {
            'id': 'a8f44e3cc0814b5601d17772cedf5417',