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

Code before:
            f'{self._API_BASE_URL}/api/videos/{video_id}/comments_v2',
            video_id, fatal=False, note=False, errnote='Unable to extract comments',
            headers={
                'Origin': 'https://triller.co',
            }, query={
                'limit': limit,
            }) or {}
        comment_data = comment_info.get('comments', [])
        comments = [{
            'author': traverse_obj(comment_dict, ('author', 'username')),
            'author_id': traverse_obj(comment_dict, ('author', 'user_id')),
            'id': comment_dict.get('id'),
            'text': comment_dict.get('body'),
            'timestamp': unified_timestamp(comment_dict.get('timestamp')),
        } for comment_dict in comment_data] if comment_data else None
        return comments

    def _parse_video_info(self, video_info, user_info=None):
        video_uuid = video_info.get('video_uuid')
        video_id = video_info.get('id')
        if not user_info:
            user_info = traverse_obj(video_info, 'user', default={})

        username = user_info.get('username')
        formats = []
        video_url = video_info.get('video_url') or video_info.get('stream_url')
        if video_url:
            formats.append({
                'url': video_url,
                'ext': 'mp4',
                'vcodec': 'h264',
                'resolution': f'{video_info.get("width")}x{video_info.get("height")}',
                'width': video_info.get('width'),
                'height': video_info.get('height'),
                'format_id': url_basename(video_url).split('.')[0],
                'filesize': video_info.get('filesize'),
            })
        video_set = video_info.get('video_set', [])
        for video in video_set:
            resolution = video.get('resolution')
            bitrate = int_or_none(video.get('bitrate')) / 1000
            video_url = video.get('url')
            formats.append({
                'url': video_url,
                'ext': 'mp4',
                'vcodec': video.get('codec'),
                'vbr': bitrate,
                'resolution': resolution,
                'width': int_or_none(resolution.split('x')[0]),
                'height': int_or_none(resolution.split('x')[1]),
                'format_id': url_basename(video_url).split('.')[0],

Review comment (suggestion):
```suggestion
        video_url = traverse_obj(video_info, 'video_url', 'stream_url')
```

Code after:

    def _parse_video_info(self, video_info, username, user_info=None):
        video_uuid = video_info.get('video_uuid')
        video_id = video_info.get('id')

        formats = []
        video_url = traverse_obj(video_info, 'video_url', 'stream_url')
        if video_url:
            formats.append({
                'url': video_url,
                'ext': 'mp4',
                'vcodec': 'h264',
                'width': video_info.get('width'),
                'height': video_info.get('height'),
                'format_id': url_basename(video_url).split('.')[0],
                'filesize': video_info.get('filesize'),
            })
        video_set = video_info.get('video_set') or []
        for video in video_set:
            resolution = video.get('resolution') or ''
            formats.append({
                'url': video['url'],
                'ext': 'mp4',
                'vcodec': video.get('codec'),
                'vbr': int_or_none(video.get('bitrate'), 1000),
                'width': int_or_none(resolution.split('x')[0]),
                'height': int_or_none(resolution.split('x')[1]),
                'format_id': url_basename(video['url']).split('.')[0],
            })
        audio_url = video_info.get('audio_url')
        if audio_url:
            formats.append({
                'url': audio_url,
                'ext': 'm4a',
                'format_id': url_basename(audio_url).split('.')[0],
            })

        manifest_url = video_info.get('transcoded_url')
        if manifest_url:
            formats.extend(self._extract_m3u8_formats(
                manifest_url, video_id, 'mp4', entry_protocol='m3u8_native',
                m3u8_id='hls', fatal=False))
        self._sort_formats(formats)

        comment_count = int_or_none(video_info.get('comment_count'))

        user_info = user_info or traverse_obj(video_info, 'user', default={})

        return {
            'id': str_or_none(video_id) or video_uuid,
            'title': video_info.get('description') or f'Video by {username}',