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

Code before:
        duration = data_json.get('duration')
        formats = []
        subtitles = {}
        description = data_json.get('description')
        series, season, season_number, episode_number = None, None, None, None

        if video_type == 'episode':
            series = data_json.get('container').get('container').get('title')
            season = data_json.get('container').get('title')
            episode_number = data_json.get('sequence')

            if season:
                match = re.match(r'Season (?P<season_number>\d+)', season)
                if match:
                    season_number = int(match.group('season_number'))

        for key in 'dash', 'hls':
            playlist_url = STREAM_URL.format(data_json['stream'][key]['high'])

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

            formats.extend(frmt)
            subtitles = self._merge_subtitles(subtitles, subs)

        self._sort_formats(formats)

        return {
            'id': video_id,
            'title': title,
            'formats': formats,
            'subtitles': subtitles,
            'display_id': display_id,
            'duration': duration,
            'series': series,
            'description': description,
            'season': season,
            'season_number': season_number,
            'episode_number': episode_number,
        }


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',

Review comment (suggestion):
You can avoid the assignation if you use

```python
self._merge_subtitles(subs, target=subtitles)
```

Code after:
            'season': 'Season 1',
            'series': 'Shaitaan',
            'episode': 'Episode 1'
        },
        'params': {
            'format': 'best',
            'skip_download': True,
        },
        'skip': 'No longer available.'
    }, {
        'url': 'https://www.mxplayer.in/show/watch-aashram/chapter-1/duh-swapna-online-d445579792b0135598ba1bc9088a84cb',
        'info_dict': {
            'id': 'd445579792b0135598ba1bc9088a84cb',
            'display_id': 'duh-swapna-online',
            'ext': 'mp4',
            'title': 'Duh Swapna',
            'description': 'md5:35ff39c4bdac403c53be1e16a04192d8',
            'season_number': 1,
            'episode_number': 3,
            'duration': 2568,
            'season': 'Season 1',
            'series': 'Aashram',
            'episode': 'Episode 3'
        },
        'params': {
            'format': 'bv',
            'skip_download': True,
        },
    }, {
        'url': 'https://www.mxplayer.in/show/watch-dangerous/season-1/chapter-1-online-5a351b4f9fb69436f6bd6ae3a1a75292',
        'info_dict': {
            'id': '5a351b4f9fb69436f6bd6ae3a1a75292',
            'display_id': 'chapter-1-online',
            'ext': 'mp4',
            'title': 'Chapter 1',
            'description': 'md5:233886b8598bc91648ac098abe1d288f',
            'season_number': 1,
            'episode_number': 1,
            'duration': 1305,
            'season': 'Season 1',
            'series': 'Dangerous',
            'episode': 'Episode 1'
        },
        'params': {
            'format': 'bv',
            'skip_download': True,
        },
    }, {
        'url': 'https://www.mxplayer.in/movie/watch-the-attacks-of-2611-movie-online-0452f0d80226c398d63ce7e3ea40fa2d',
        'info_dict': {
            'id': '0452f0d80226c398d63ce7e3ea40fa2d',