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

Code before:
    def _real_extract(self, url):
        query = {'url': url}
        info_url = update_url_query(self._FEED_URL, query)
        video_id = self._match_id(url)
        info = self._download_json(info_url, video_id).get('manifest')

        redirect = try_get(
            info, lambda x: x['newLocation']['url'], compat_str)
        if redirect:
            return self.url_result(redirect)

        title = info.get('title')
        video_id = try_get(
            info, lambda x: x['reporting']['itemId'], compat_str)
        parent_id = try_get(
            info, lambda x: x['reporting']['parentId'], compat_str)

        playlist_url = current_url = None
        zones = info.get('zones') or []
        for z in zones:
            if zones[z].get('moduleName') in {'INTL_M304', 'INTL_M209'}:
                info_url = zones[z].get('feed')
            if zones[z].get('moduleName') in {'INTL_M308', 'INTL_M317'}:
                playlist_url = playlist_url or zones[z].get('feed')
            if zones[z].get('moduleName') in {'INTL_M300'}:
                current_url = current_url or zones[z].get('feed')

        if not info_url:
            raise ExtractorError('No info found')

        if video_id == parent_id:
            video_id = self._search_regex(
                r'([^\/]+)/[^\/]+$', info_url, 'video_id')

        info = self._download_json(info_url, video_id, 'Show infos')
        info = try_get(info, lambda x: x['result']['data'], dict)
        title = title or try_get(
            info, (
                lambda x: x['title'],
                lambda x: x['headline']),
            compat_str)
        description = try_get(info, lambda x: x['content'], compat_str)

        if current_url:
            season = try_get(
                self._download_json(playlist_url, video_id, 'Seasons infos'),
                lambda x: x['result']['data'], dict)
            current = try_get(
                season, lambda x: x['currentSeason'], compat_str)
            seasons = try_get(
                season, lambda x: x['seasons'], list) or []

Review comment (suggestion):
Untested!

```suggestion
        for z in (info.get('zones') or {}).values():
            if z.get('moduleName') in ('INTL_M304', 'INTL_M209'):
                info_url = z.get('feed')
            if z.get('moduleName') in ('INTL_M308', 'INTL_M317'):
                playlist_url = playlist_url or z.get('feed')
            if z.get('moduleName') in ('INTL_M300',):
                current_url = current_url or z.get('feed')
```

Code after:
        query = {'url': url}
        info_url = update_url_query(self._FEED_URL, query)
        video_id = self._match_id(url)
        info = self._download_json(info_url, video_id).get('manifest')

        redirect = try_get(
            info, lambda x: x['newLocation']['url'], compat_str)
        if redirect:
            return self.url_result(redirect)

        title = info.get('title')
        video_id = try_get(
            info, lambda x: x['reporting']['itemId'], compat_str)
        parent_id = try_get(
            info, lambda x: x['reporting']['parentId'], compat_str)

        playlist_url = current_url = None
        for z in (info.get('zones') or {}).values():
            if z.get('moduleName') in ('INTL_M304', 'INTL_M209'):
                info_url = z.get('feed')
            if z.get('moduleName') in ('INTL_M308', 'INTL_M317'):
                playlist_url = playlist_url or z.get('feed')
            if z.get('moduleName') in ('INTL_M300',):
                current_url = current_url or z.get('feed')

        if not info_url:
            raise ExtractorError('No info found')

        if video_id == parent_id:
            video_id = self._search_regex(
                r'([^\/]+)/[^\/]+$', info_url, 'video_id')

        info = self._download_json(info_url, video_id, 'Show infos')
        info = try_get(info, lambda x: x['result']['data'], dict)
        title = title or try_get(
            info, (
                lambda x: x['title'],
                lambda x: x['headline']),
            compat_str)
        description = try_get(info, lambda x: x['content'], compat_str)

        if current_url:
            season = try_get(
                self._download_json(playlist_url, video_id, 'Seasons info'),
                lambda x: x['result']['data'], dict)
            current = try_get(
                season, lambda x: x['currentSeason'], compat_str)
            seasons = try_get(
                season, lambda x: x['seasons'], list) or []

            if current in [s.get('eTitle') for s in seasons]: