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

Code before:
            'thumbnail': r're:^https?://.*\.jpeg$',
            'ext': 'mp4'
        }
    }

    def _real_extract(self, url):
        video_id = self._match_id(url)
        episode_json = self._download_json('https://dak1vd5vmi7x6.cloudfront.net/api/v1/publicrole/showmodule/episodedetails?id=' + video_id, video_id)
        details = episode_json.get('details', {})
        series = details.get('showTitle')
        season_number = details.get('analyticsSeasonNumber')
        if not(season_number.isdigit()):
            season_number = 0
        episode_number = details.get('episodeNumber')
        if not(episode_number.isdigit()):
            episode_number = 0
        title = details.get('episodeTitle')
        episode_id = details.get('analyticsEpisodeTitle')
        description = details.get('episodeDescription')
        duration = details.get('durationInMinutes') * 60
        view_count = details.get('viewCount')
        categories = [details.get('videoCategory')]
        video_url = details.get('videoM3u8Url')
        thumbnail = details.get('episodelandscapeImgIxUrl')
        ext = 'mp4'
        formats = self._extract_m3u8_formats(video_url, video_id, ext)
        return {
            'id': video_id,
            'series': series,
            'season_number': int(season_number),
            'episode_number': int(episode_number),
            'episode_id': episode_id,
            'duration': duration,
            'view_count': view_count,
            'categories': categories,
            'title': title,
            'description': description,
            'thumbnail': thumbnail,
            'ext': ext,
            'formats': formats,
        }


class ManotoTVShowIE(InfoExtractor):
    IE_NAME = 'Manoto TV (Show)'
    _VALID_URL = r'https?://(?:www\.)?manototv\.com/show/(?P<id>[0-9]+)'
    _TESTS = [{
        'url': 'https://www.manototv.com/show/2526',
        'playlist_mincount': 68,
        'info_dict': {
            'id': '2526',

Review comment (refactor):
```suggestion
        formats = self._extract_m3u8_formats(video_url, video_id, 'mp4')
```

Code after:
            'season_number': 7,
            'episode_number': 25,
            'episode_id': 'My Dream Home S7: Carol & John',
            'duration': 3600,
            'categories': ['سرگرمی'],
            'title': 'کارول و جان',
            'description': 'md5:d0fff1f8ba5c6775d312a00165d1a97e',
            'thumbnail': r're:^https?://.*\.(jpeg|png|jpg)$',
            'ext': 'mp4'
        },
        'params': {
            'skip_download': 'm3u8',
        }
    }, {
        'url': 'https://www.manototv.com/episode/12576',
        'info_dict': {
            'id': '12576',
            'series': 'فیلم های ایرانی',
            'episode_id': 'Seh Mah Taatili',
            'duration': 5400,
            'view_count': int,
            'categories': ['سرگرمی'],
            'title': 'سه ماه تعطیلی',
            'description': 'سه ماه تعطیلی فیلمی به کارگردانی و نویسندگی شاپور قریب ساختهٔ سال ۱۳۵۶ است.',
            'thumbnail': r're:^https?://.*\.(jpeg|png|jpg)$',
            'ext': 'mp4'
        },
        'params': {
            'skip_download': 'm3u8',
        }
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        episode_json = self._download_json(_API_URL.format('showmodule', 'episodedetails', video_id), video_id)
        details = episode_json.get('details', {})
        formats = self._extract_m3u8_formats(details.get('videoM3u8Url'), video_id, 'mp4')
        self._sort_formats(formats)
        return {
            'id': video_id,
            'series': details.get('showTitle'),
            'season_number': int_or_none(details.get('analyticsSeasonNumber')),
            'episode_number': int_or_none(details.get('episodeNumber')),
            'episode_id': details.get('analyticsEpisodeTitle'),
            'duration': int_or_none(details.get('durationInMinutes'), invscale=60),
            'view_count': details.get('viewCount'),
            'categories': [details.get('videoCategory')],
            'title': details.get('episodeTitle'),
            'description': clean_html(details.get('episodeDescription')),
            'thumbnail': details.get('episodelandscapeImgIxUrl'),
            'formats': formats,