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

Code before:
                'width': int_or_none(video.get('vwidth')),
                'height': int_or_none(video.get('vheight')),
                'fps': int_or_none(video.get('fps')),
                'vcodec': video.get('codec_type'),
                'format_id': str(video.get('quality_type')),
                'ext': 'mp4' if parse_qs(video_url).get('mime_type')[0] == 'video_mp4' else 'mp4', 
                **video_type_based_format
            }

            _single_video_format.append(base_format)
        return _single_video_format

    def _real_extract(self, url):
        video_id = self._match_id(url)
        # need to pass cookie (at least contain __ac_nonce and ttwid)
        webpage = self._download_webpage(url, video_id)

        json_data = self._get_json_data(webpage, video_id)
        video_info = traverse_obj(json_data, ('anyVideo', 'gidInformation', 'packerData', 'video', 'videoResource'))

        format_ = list()
        for video_type, json_ in video_info.items():
            if not isinstance(json_, dict):
                continue
            video_format = self._get_video_format(video_type, json_)
            format_.extend(video_format)

        self._sort_formats(format_)
        return {
            'id': video_id,
            'title': traverse_obj(json_data, ('anyVideo', 'gidInformation', 'packerData', 'video', 'title')),
            'description': traverse_obj(json_data, ('anyVideo', 'gidInformation', 'packerData', 'video', 'video_abstract')),
            'formats': format_,
            'like_count': traverse_obj(json_data, ('anyVideo', 'gidInformation', 'packerData', 'video', 'video_like_count')),
            'duration': int_or_none(traverse_obj(json_data, ('anyVideo', 'gidInformation', 'packerData', 'video', 'video_duration'))),
            'tag': traverse_obj(json_data, ('anyVideo', 'gidInformation', 'packerData', 'video', 'tag')),

        }


Review comment (suggestion):
```suggestion
        formats = []
        for video_type, video_json in video_info.items():
            if not isinstance(video_json, dict):
                continue
            formats.extend(self._get_video_format(video_type, video_json))
```

Code after:
                    'url': base64.b64decode(media['main_url']).decode(),
                    'width': int_or_none(media.get('vwidth')),
                    'height': int_or_none(media.get('vheight')),
                    'fps': int_or_none(media.get('fps')),
                    'vcodec': media.get('codec_type'),
                    'format_id': str_or_none(media.get('quality_type')),
                    'filesize': int_or_none(media.get('size')),
                    'ext': 'mp4',
                    **override,
                }

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)
        json_data = self._get_json_data(webpage, video_id)['anyVideo']['gidInformation']['packerData']['video']

        formats = list(self._media_selector(json_data.get('videoResource')))
        self._sort_formats(formats)
        return {
            'id': video_id,
            'title': json_data.get('title'),
            'description': json_data.get('video_abstract'),
            'formats': formats,
            'like_count': json_data.get('video_like_count'),
            'duration': int_or_none(json_data.get('duration')),
            'tags': [json_data.get('tag')],
            'uploader_id': traverse_obj(json_data, ('user_info', 'user_id')),
            'uploader': traverse_obj(json_data, ('user_info', 'name')),
            'view_count': json_data.get('video_watch_count'),
            'dislike_count': json_data.get('video_unlike_count'),
            'timestamp': int_or_none(json_data.get('video_publish_time')),
        }