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

Code before:
            for download_url in traverse_obj(video_info, (('downloadAddr', ('download', 'url')), {url_or_none})):
                formats.append({
                    'format_id': 'download',
                    'url': self._proto_relative_url(download_url),
                    'ext': 'mp4',
                    'width': width,
                    'height': height,
                })

        else:
            for play_url in traverse_obj(video_info, ('play_addr', 'url_list', ...)):
                formats.append({
                    'url': play_url,
                    'ext': 'mp4',
                    'width': width,
                    'height': height,
                })

            for download_url in traverse_obj(video_info, ('download_addr', 'url_list', ...)):
                formats.append({
                    'format_id': 'download',
                    'url': download_url,
                    'ext': 'mp4',
                    'width': width,
                    'height': height,
                })

        self._remove_duplicate_formats(formats)

        thumbnails = []
        for thumb_url in traverse_obj(aweme_detail, (
                (None, 'video'), ('thumbnail', 'cover', 'dynamicCover', 'originCover'), {url_or_none})):
            thumbnails.append({
                'url': self._proto_relative_url(thumb_url),
                'width': width,
                'height': height,
            })

        return {
            'id': video_id,
            **traverse_obj(aweme_detail, {
                'title': ('desc', {str}),
                'description': ('desc', {str}),
                'duration': ('video', 'duration', {int_or_none}),
                'timestamp': ('createTime', {int_or_none}),
            }),
            **traverse_obj(author_info or aweme_detail, {
                'creator': ('nickname', {str}),
                'uploader': (('uniqueId', 'author'), {str}),
                'uploader_id': (('authorId', 'uid', 'id'), {str_or_none}),
            }, get_all=False),

Review comment (suggestion):
revert
```suggestion
        for download_url in traverse_obj(video_info, (('downloadAddr', ('download', 'url')), {url_or_none})):
            formats.append({
                'format_id': 'download',
                'url': self._proto_relative_url(download_url),
                'ext': 'mp4',
                'width': width,
                'height': height,
            })
```

Code after:
                'format_id': 'download',
                'url': self._proto_relative_url(download_url),
                'ext': 'mp4',
                'width': width,
                'height': height,
            })

        self._remove_duplicate_formats(formats)

        thumbnails = []
        for thumb_url in traverse_obj(aweme_detail, (
                (None, 'video'), ('thumbnail', 'cover', 'dynamicCover', 'originCover'), {url_or_none})):
            thumbnails.append({
                'url': self._proto_relative_url(thumb_url),
                'width': width,
                'height': height,
            })

        return {
            'id': video_id,
            **traverse_obj(aweme_detail, {
                'title': ('desc', {str}),
                'description': ('desc', {str}),
                'duration': ('video', 'duration', {int_or_none}),
                'timestamp': ('createTime', {int_or_none}),
            }),
            **traverse_obj(author_info or aweme_detail, {
                'creator': ('nickname', {str}),
                'uploader': (('uniqueId', 'author'), {str}),
                'uploader_id': (('authorId', 'uid', 'id'), {str_or_none}),
            }, get_all=False),
            **traverse_obj(stats_info, {
                'view_count': 'playCount',
                'like_count': 'diggCount',
                'repost_count': 'shareCount',
                'comment_count': 'commentCount',
            }, expected_type=int_or_none),
            **traverse_obj(music_info, {
                'track': 'title',
                'album': ('album', {lambda x: x or None}),
                'artist': 'authorName',
            }, expected_type=str),
            'channel_id': channel_id,
            'uploader_url': user_url,
            'formats': formats,
            'thumbnails': thumbnails,
            'http_headers': {
                'Referer': webpage_url,
            }
        }