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

Code before:
            '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',
            'timestamp': 1742869615,
            'upload_date': '20250325',
            'creators': ['xQc'],
            'channel': 'xQc',
            'channel_id': '71092938',
            'channel_is_verified': True,
            'channel_follower_count': int,
            'uploader': 'okSTFUdude',
            'uploader_id': '744085721',
            'categories': ['Just Chatting'],
        },
    }, {
        # multiple formats
        'url': 'https://clips.twitch.tv/rflegendary/UninterestedBeeDAESuppy',
        'only_matching': True,
    }, {
        'url': 'https://www.twitch.tv/sergeynixon/clip/StormyThankfulSproutFutureMan',
        'only_matching': True,
    }, {
        'url': 'https://clips.twitch.tv/embed?clip=InquisitiveBreakableYogurtJebaited',
        'only_matching': True,
    }, {
        'url': 'https://m.twitch.tv/rossbroadcast/clip/ConfidentBraveHumanChefFrank',
        'only_matching': True,
    }, {
        'url': 'https://go.twitch.tv/rossbroadcast/clip/ConfidentBraveHumanChefFrank',
        'only_matching': True,
    }, {
        'url': 'https://m.twitch.tv/clip/FaintLightGullWholeWheat',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        slug = self._match_id(url)

Review comment (refactor):
we should try to keep metadata consistent with the other extractors in the module, e.g. `TwitchVodIE`'s should extract the same value for `uploader_id` as this extractor does for VODs/clips by the same uploader

Code after:
            '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,
            'thumbnail': r're:^https?://.*\.jpg',
            'timestamp': 1742869615,
            'upload_date': '20250325',
            'creators': ['xQc'],
            'channel': 'xQc',
            'channel_id': '71092938',
            'channel_is_verified': True,
            'channel_follower_count': int,
            'uploader': 'xQc',
            'uploader_id': '71092938',
            'categories': ['Just Chatting'],
        },
    }, {
        # multiple formats
        'url': 'https://clips.twitch.tv/rflegendary/UninterestedBeeDAESuppy',
        'only_matching': True,
    }, {
        'url': 'https://www.twitch.tv/sergeynixon/clip/StormyThankfulSproutFutureMan',
        'only_matching': True,
    }, {
        'url': 'https://clips.twitch.tv/embed?clip=InquisitiveBreakableYogurtJebaited',
        'only_matching': True,
    }, {
        'url': 'https://m.twitch.tv/rossbroadcast/clip/ConfidentBraveHumanChefFrank',
        'only_matching': True,
    }, {
        'url': 'https://go.twitch.tv/rossbroadcast/clip/ConfidentBraveHumanChefFrank',
        'only_matching': True,
    }, {
        'url': 'https://m.twitch.tv/clip/FaintLightGullWholeWheat',
        'only_matching': True,
    }]

    def _real_extract(self, url):