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

Code before:
            'timestamp': 1514264429,
            'upload_date': '20171226',
            'thumbnail': r're:https://.*\.jpg',
            'uploader': '柴犬柴犬',
            'uploader_id': '5926682210',
            'uploader_url': 'https://weibo.com/u/5926682210',
            'view_count': int,
            'like_count': int,
            'repost_count': int,
        },
    }, {
        'url': 'https://weibo.com/0/4224132150961381',
        'note': 'no playback_list example',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)

        meta = self._weibo_download_json(f'https://weibo.com/ajax/statuses/show?id={video_id}', video_id)
        mix_media_info = traverse_obj(meta, ('mix_media_info', 'items'))
        if not mix_media_info:
            return self._parse_video_info(meta)

        playlist_title = traverse_obj(mix_media_info, (0, 'data', 'content1'))
        return self.playlist_result(self._entries(mix_media_info), playlist_title=playlist_title)

    def _entries(self, mix_media_info):
        for media_info in mix_media_info:
            if media_info.get('type') == 'pic':
                continue

            video_info = {
                **traverse_obj(media_info, {
                    'id': ('data', 'object_id'),
                    'page_info': {'media_info': ('data', 'media_info')},
                }),
            }

            # fix filename too long
            del video_info['page_info']['media_info']['kol_title']

            yield self._parse_video_info(video_info)


class WeiboVideoIE(WeiboBaseIE):
    _VALID_URL = r'https?://(?:www\.)?weibo\.com/tv/show/(?P<id>\d+:\d+)'
    _TESTS = [{
        'url': 'https://weibo.com/tv/show/1034:4797699866951785?from=old_pc_videoshow',
        'info_dict': {
            'id': '4797700463137878',

Review comment (suggestion):
I'd rather return just an id and no title instead of arbitrarily using the first entry's title
```suggestion
        return self.playlist_result(self._entries(mix_media_info), video_id)
```

Code after:
        'only_matching': True,
    }, {
        'url': 'https://weibo.com/0/4224132150961381',
        'note': 'no playback_list example',
        'only_matching': True,
    }, {
        'url': 'https://m.weibo.cn/detail/5120561132606436',
        'info_dict': {
            'id': '5120561132606436',
        },
        'playlist_count': 9,
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)

        meta = self._weibo_download_json(f'https://weibo.com/ajax/statuses/show?id={video_id}', video_id)
        mix_media_info = traverse_obj(meta, ('mix_media_info', 'items', ...))
        if not mix_media_info:
            return self._parse_video_info(meta)

        return self.playlist_result(self._entries(mix_media_info), video_id)

    def _entries(self, mix_media_info):
        for media_info in traverse_obj(mix_media_info, lambda _, v: v['type'] != 'pic'):
            yield self._parse_video_info(traverse_obj(media_info, {
                'id': ('data', 'object_id'),
                'page_info': {'media_info': ('data', 'media_info', {dict})},
            }))


class WeiboVideoIE(WeiboBaseIE):
    _VALID_URL = r'https?://(?:www\.)?weibo\.com/tv/show/(?P<id>\d+:\d+)'
    _TESTS = [{
        'url': 'https://weibo.com/tv/show/1034:4797699866951785?from=old_pc_videoshow',
        'info_dict': {
            'id': '4797700463137878',
            'ext': 'mp4',
            'display_id': 'LEZDodaiW',
            'title': '呃，稍微了解了一下靡烟miya，感觉这东西也太二了',
            'description': '呃，稍微了解了一下靡烟miya，感觉这东西也太二了 http://t.cn/A6aerGsM \u200b\u200b\u200b',
            'duration': 76,
            'timestamp': 1659344278,
            'upload_date': '20220801',
            'thumbnail': r're:https://.*\.jpg',
            'uploader': '君子爱财陈平安',
            'uploader_id': '3905382233',
            'uploader_url': 'https://weibo.com/u/3905382233',
            'view_count': int,
            'like_count': int,
            'repost_count': int,