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

Code before:
        if traverse_obj(video_info, (
                None, ('transcoded_url', 'video_url', 'stream_url', 'audio_url'),
                {lambda x: re.search(r'/copyright/', x)}), get_all=False):
            self.raise_no_formats('This video has been removed due to licensing restrictions', expected=True)

        def format_info(url):
            return {
                'url': url,
                'ext': determine_ext(url),
                'format_id': url_basename(url).split('.')[0],
            }

        formats = []

        if determine_ext(video_info.get('transcoded_url')) == 'm3u8':
            formats.extend(self._extract_m3u8_formats(
                video_info['transcoded_url'], video_id, 'mp4', m3u8_id='hls', fatal=False))

        for video in traverse_obj(video_info, ('video_set', lambda _, v: url_or_none(v['url']))):
            formats.append({
                **format_info(video['url']),
                **parse_resolution(video.get('resolution')),
                **traverse_obj(video, {
                    'vcodec': 'codec',
                    'vbr': ('bitrate', {lambda x: int_or_none(x, 1000)}),
                }),
            })

        video_url = traverse_obj(video_info, 'video_url', 'stream_url', expected_type=url_or_none)
        if video_url:
            formats.append({
                **format_info(video_url),
                'vcodec': 'h264',
                **traverse_obj(video_info, {
                    'width': ('width', {int_or_none}),
                    'height': ('height', {int_or_none}),
                    'filesize': ('filesize', {int_or_none}),
                }),
            })

        audio_url = url_or_none(video_info.get('audio_url'))
        if audio_url:
            formats.append(format_info(audio_url))

        comment_count = traverse_obj(video_info, ('comment_count', {int_or_none}))

        return {
            'id': video_id,
            'display_id': display_id,
            'uploader': username,
            'uploader_id': user_id,

Review comment (suggestion):
```suggestion
                'vcodec': video.get('codec'),
                'vbr': int_or_none(video.get('bitrate'), 1000),
```
is just simpler here

Code after:
                None, ('transcoded_url', 'video_url', 'stream_url', 'audio_url'),
                {lambda x: re.search(r'/copyright/', x)}), get_all=False):
            self.raise_no_formats('This video has been removed due to licensing restrictions', expected=True)

        def format_info(url):
            return {
                'url': url,
                'ext': determine_ext(url),
                'format_id': url_basename(url).split('.')[0],
            }

        formats = []

        if determine_ext(video_info.get('transcoded_url')) == 'm3u8':
            formats.extend(self._extract_m3u8_formats(
                video_info['transcoded_url'], video_id, 'mp4', m3u8_id='hls', fatal=False))

        for video in traverse_obj(video_info, ('video_set', lambda _, v: url_or_none(v['url']))):
            formats.append({
                **format_info(video['url']),
                **parse_resolution(video.get('resolution')),
                'vcodec': video.get('codec'),
                'vbr': int_or_none(video.get('bitrate'), 1000),
            })

        video_url = traverse_obj(video_info, 'video_url', 'stream_url', expected_type=url_or_none)
        if video_url:
            formats.append({
                **format_info(video_url),
                'vcodec': 'h264',
                **traverse_obj(video_info, {
                    'width': 'width',
                    'height': 'height',
                    'filesize': 'filesize',
                }, expected_type=int_or_none),
            })

        audio_url = url_or_none(video_info.get('audio_url'))
        if audio_url:
            formats.append(format_info(audio_url))

        comment_count = traverse_obj(video_info, ('comment_count', {int_or_none}))

        return {
            'id': video_id,
            'display_id': display_id,
            'uploader': username,
            'uploader_id': user_id or traverse_obj(video_info, ('user', 'user_id', {str_or_none})),
            'webpage_url': urljoin(f'https://triller.co/@{username}/video/', display_id),
            'uploader_url': f'https://triller.co/@{username}',
            'extractor_key': TrillerIE.ie_key(),