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

Code before:
        for frmt, frmt_path in media_data.get('transcoded', {}).items():
            formats.append({
                'format_id': frmt,
                'width': str_to_int(frmt[1:]),
                'url': base_url + frmt_path,
            })
        if media_data.get('path'):
            formats.append({
                'format_id': 'original',
                'format_note': 'Direct video.',
                'url': base_url + '/apipublic' + media_data['path'],
                'quality': 10,
            })
        self._sort_formats(formats)

        return {
            'id': id,
            'title': compat_urllib_parse_unquote_plus(clean_html(post_data.get('caption'))),
            'description': compat_urllib_parse_unquote_plus(clean_html(post_data.get('caption'))),
            'duration': media_data.get('duration'),
            'thumbnail': base_url + media_data.get('thumbnail', ''),
            'like_count': post_data.get('likeCount'),
            'view_count': post_data.get('viewsCount'),
            'comment_count': post_data.get('commentCount'),
            'repost_count': post_data.get('shareCount'),
            'timestamp': str_to_int(post_data.get('created_at')) // 1000,
            'uploader_id': post_data.get('userId') or author_data.get('_id'),
            'uploader': author_data.get('name'),
            'uploader_url': 'https://chingari.io/' + author_data.get('username', ''),
            'track': song_data.get('title'),
            'artist': song_data.get('author'),
            'formats': formats,
        }


class ChingariIE(ChingariBaseIE):
    _VALID_URL = r'(?:https?://)(?:www\.)?chingari\.io/share/post\?id=(?P<id>[^&/#?]+)'
    _TESTS = [{
        'url': 'https://chingari.io/share/post?id=612f8f4ce1dc57090e8a7beb',
        'info_dict': {
            'id': '612f8f4ce1dc57090e8a7beb',
            'ext': 'mp4',
            'title': 'Happy birthday Srila Prabhupada',
            'description': 'md5:c7080ebfdfeb06016e638c286d6bc3fa',
            'duration': 0,
            'thumbnail': 'https://media.chingari.io/uploads/c41d30e2-06b6-4e3b-9b4b-edbb929cec06-1630506826911/thumbnail/198f993f-ce87-4623-82c6-cd071bd6d4f4-1630506828016.jpg',
            'like_count': 12812,
            'view_count': 1530296,
            'comment_count': 5,
            'repost_count': 0,
            'timestamp': 1630506828,

Review comment (suggestion):
Do you have to use `str_to_int`? If not,
```suggestion
            'timestamp': int_or_none(post_data.get('created_at'), 1000),
```
If you do, still take care that `None // 1000` doesnt throw error

Code after:

        formats = [{
            'format_id': frmt,
            'width': str_to_int(frmt[1:]),
            'url': base_url + frmt_path,
        } for frmt, frmt_path in media_data.get('transcoded', {}).items()]

        if media_data.get('path'):
            formats.append({
                'format_id': 'original',
                'format_note': 'Direct video.',
                'url': base_url + '/apipublic' + media_data['path'],
                'quality': 10,
            })
        self._sort_formats(formats)
        timestamp = str_to_int(post_data.get('created_at'))
        if timestamp:
            timestamp = int_or_none(timestamp, 1000)

        thumbnail, uploader_url = None, None
        if media_data.get('thumbnail'):
            thumbnail = base_url + media_data.get('thumbnail')
        if author_data.get('username'):
            uploader_url = 'https://chingari.io/' + author_data.get('username')

        return {
            'id': id,
            'title': compat_urllib_parse_unquote_plus(clean_html(post_data.get('caption'))),
            'description': compat_urllib_parse_unquote_plus(clean_html(post_data.get('caption'))),
            'duration': media_data.get('duration'),
            'thumbnail': url_or_none(thumbnail),
            'like_count': post_data.get('likeCount'),
            'view_count': post_data.get('viewsCount'),
            'comment_count': post_data.get('commentCount'),
            'repost_count': post_data.get('shareCount'),
            'timestamp': timestamp,
            'uploader_id': post_data.get('userId') or author_data.get('_id'),
            'uploader': author_data.get('name'),
            'uploader_url': url_or_none(uploader_url),
            'track': song_data.get('title'),
            'artist': song_data.get('author'),
            'formats': formats,
        }


class ChingariIE(ChingariBaseIE):
    _VALID_URL = r'(?:https?://)(?:www\.)?chingari\.io/share/post\?id=(?P<id>[^&/#?]+)'
    _TESTS = [{
        'url': 'https://chingari.io/share/post?id=612f8f4ce1dc57090e8a7beb',
        'info_dict': {
            'id': '612f8f4ce1dc57090e8a7beb',