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

Code before:
            'uploader_id': channel_name,
            'timestamp': timestamp,
            'view_count': view_count,
            'formats': formats,
            'is_live': stream_type == 'live',
        }


class TwitchClipsIE(TwitchBaseIE):
    IE_NAME = 'twitch:clips'
    _VALID_URL = r'''(?x)
                    https?://
                        (?:
                            clips\.twitch\.tv/(?:embed\?.*?\bclip=|(?:[^/]+/)*)|
                            (?:(?:www|go|m)\.)?twitch\.tv/(?:[^/]+/)?clip/
                        )
                        (?P<id>[^/?#&]+)
                    '''

    _TESTS = [{
        'url': 'https://clips.twitch.tv/FaintLightGullWholeWheat',
        'md5': '761769e1eafce0ffebfb4089cb3847cd',
        'info_dict': {
            'id': '396245304',
            'display_id': 'FaintLightGullWholeWheat',
            'ext': 'mp4',
            'title': 'EA Play 2016 Live from the Novo Theatre',
            'duration': 32,
            'view_count': int,
            'thumbnail': r're:^https?://.*\.jpg',
            'timestamp': 1465767393,
            'upload_date': '20160612',
            'creators': ['EA'],
            'channel': 'EA',
            'channel_id': '25163635',
            'channel_is_verified': False,
            'channel_follower_count': int,
            'uploader': 'stereotype_',
            'uploader_id': '43566419',
        },
    }, {
        'url': 'https://www.twitch.tv/xqc/clip/CulturedAmazingKuduDatSheffy-TiZ_-ixAGYR3y2Uy',
        'md5': 'e90fe616b36e722a8cfa562547c543f0',
        'info_dict': {
            'id': '3207364882',
            'display_id': 'CulturedAmazingKuduDatSheffy-TiZ_-ixAGYR3y2Uy',
            'ext': 'mp4',
            'title': 'A day in the life of xQc',
            'duration': 60,
            'view_count': int,
            'thumbnail': r're:^https?://.*\.jpg',

Review comment (suggestion):
Is there any way to get the old ID value with the new query, so that we don't break download archive compat?

(I wonder why we weren't just using the slug/`display_id` to begin with)

Code after:
            'uploader': uploader,
            'uploader_id': channel_name,
            'timestamp': timestamp,
            'view_count': view_count,
            'formats': formats,
            'is_live': stream_type == 'live',
        }


class TwitchClipsIE(TwitchBaseIE):
    IE_NAME = 'twitch:clips'
    _VALID_URL = r'''(?x)
                    https?://
                        (?:
                            clips\.twitch\.tv/(?:embed\?.*?\bclip=|(?:[^/]+/)*)|
                            (?:(?:www|go|m)\.)?twitch\.tv/(?:[^/]+/)?clip/
                        )
                        (?P<id>[^/?#&]+)
                    '''

    _TESTS = [{
        'url': 'https://clips.twitch.tv/FaintLightGullWholeWheat',
        'md5': '761769e1eafce0ffebfb4089cb3847cd',
        'info_dict': {
            'id': '396245304',
            'display_id': 'FaintLightGullWholeWheat',
            'ext': 'mp4',
            'title': 'EA Play 2016 Live from the Novo Theatre',
            'duration': 32,
            'view_count': int,
            'thumbnail': r're:^https?://.*\.jpg',
            'timestamp': 1465767393,
            'upload_date': '20160612',
            'creators': ['EA'],
            'channel': 'EA',
            'channel_id': '25163635',
            'channel_is_verified': False,
            'channel_follower_count': int,
            'uploader': 'EA',
            'uploader_id': '25163635',
        },
    }, {
        'url': 'https://www.twitch.tv/xqc/clip/CulturedAmazingKuduDatSheffy-TiZ_-ixAGYR3y2Uy',
        'md5': 'e90fe616b36e722a8cfa562547c543f0',
        'info_dict': {
            'id': '3207364882',
            'display_id': 'CulturedAmazingKuduDatSheffy-TiZ_-ixAGYR3y2Uy',
            'ext': 'mp4',
            'title': 'A day in the life of xQc',
            'duration': 60,
            'view_count': int,