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

Code before:
            'md5': 'fd47ba68933f9dce27accc52275be9c3',
            'info_dict': {
                'id': '108618228543962049',
                'ext': 'mp4',
                'title': 'md5:d313e7659709bf212e3c719d12e2763e',
                'description': 'md5:de2fc49045bf92bb8dc97e56503b150f',
                'timestamp': 1657382637,
                'upload_date': '20220709',
                'uploader': 'Project Veritas Action',
                'uploader_id': 'ProjectVeritasAction',
                'uploader_url': 'https://truthsocial.com/@ProjectVeritasAction',
                'repost_count': int,
                'comment_count': int,
                'like_count': int,
            },
        },
    ]
    _GEO_COUNTRIES = ['US']  # The site is only available in the US

    def _real_extract(self, url):
        # Get data from API
        video_id = self._match_id(url)
        status = self._download_json(
            'https://truthsocial.com/api/v1/statuses/' + video_id,
            video_id
        )

        # Pull out video
        url = status['media_attachments'][0]['url']

        # Return the stuff
        uploader_id = strip_or_none(traverse_obj(status, ('account', 'username')))
        post = strip_or_none(clean_html(status.get('content')))

        # Set the title, handling case where its too long or empty
        if len(post) > 40:
            title = post[:35] + "[...]"
        elif len(post) == 0:
            title = self._generic_title(url)
        else:
            title = post

        return {
            'id': video_id,
            'url': url,
            'title': title,
            'description': post,
            'timestamp': unified_timestamp(status.get('created_at')),
            'uploader': strip_or_none(traverse_obj(status, ('account', 'display_name'))),
            'uploader_id': uploader_id,
            'uploader_url': ('https://truthsocial.com/@' + uploader_id) if uploader_id else None,

Review comment (suggestion):
read coding conventions
```suggestion
        video_id = self._match_id(url)
        status = self._download_json(
            f'https://truthsocial.com/api/v1/statuses/{video_id}', video_id)
```

Code after:
                'id': '108618228543962049',
                'ext': 'mp4',
                'title': 'md5:debde7186cf83f60ff7b44dbb9444e35',
                'description': 'md5:de2fc49045bf92bb8dc97e56503b150f',
                'timestamp': 1657382637,
                'upload_date': '20220709',
                'uploader': 'Project Veritas Action',
                'uploader_id': 'ProjectVeritasAction',
                'uploader_url': 'https://truthsocial.com/@ProjectVeritasAction',
                'repost_count': int,
                'comment_count': int,
                'like_count': int,
            },
        },
    ]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        status = self._download_json(f'https://truthsocial.com/api/v1/statuses/{video_id}', video_id)
        uploader_id = strip_or_none(traverse_obj(status, ('account', 'username')))
        return {
            'id': video_id,
            'url': status['media_attachments'][0]['url'],
            'title': '',
            'description': strip_or_none(clean_html(status.get('content'))) or None,
            'timestamp': unified_timestamp(status.get('created_at')),
            'uploader': strip_or_none(traverse_obj(status, ('account', 'display_name'))),
            'uploader_id': uploader_id,
            'uploader_url': format_field(uploader_id, None, 'https://truthsocial.com/@%s'),
            'repost_count': int_or_none(status.get('reblogs_count')),
            'like_count': int_or_none(status.get('favourites_count')),
            'comment_count': int_or_none(status.get('replies_count')),
        }