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

Code before:
                    source_name = source_file.get('public_name', 'Original')
                    if self._is_valid_url(download_url, video_id, '%s video' % source_name):
                        ext = (try_get(
                            source_file, lambda x: x['extension'],
                            compat_str) or determine_ext(
                            download_url, None) or 'mp4').lower()
                        return {
                            'url': download_url,
                            'ext': ext,
                            'width': int_or_none(source_file.get('width')),
                            'height': int_or_none(source_file.get('height')),
                            'filesize': parse_filesize(source_file.get('size')),
                            'format_id': source_name,
                            'quality': 1,
                        }

    def _extract_original_format_2(self, video_id):
        jwt_response = self._download_json('https://vimeo.com/_rv/viewer', video_id)
        if jwt_response.get('jwt'):
            headers = {'Authorization': f"jwt {jwt_response['jwt']}"}
            original_response = self._download_json('https://api.vimeo.com/videos/' + video_id, video_id, headers=headers)
            for download_data in original_response.get('download'):
                if download_data['quality'] == 'source':
                    return {
                        'url': download_data['link'],
                        'ext': download_data['link'][-3:] or 'mp4',
                        'format_id': download_data['quality'],
                        'width': int_or_none(download_data.get('width')),
                        'height': int_or_none(download_data.get('height')),
                        'fps': int_or_none(download_data.get('fps')),
                        'quality': 1,
                    }


class VimeoIE(VimeoBaseInfoExtractor):
    """Information extractor for vimeo.com."""

    # _VALID_URL matches Vimeo URLs
    _VALID_URL = r'''(?x)
                    https?://
                        (?:
                            (?:
                                www|
                                player
                            )
                            \.
                        )?
                        vimeo(?:pro)?\.com/
                        (?!(?:channels|album|showcase)/[^/?#]+/?(?:$|[?#])|[^/]+/review/|ondemand/)
                        (?:.*?/)?
                        (?:

Review comment (suggestion):
idk of any 4 letter extension for a video file.
Lemme know how this should be handled 
`determine_ext` this wasn't working

Code after:
                    source_name = source_file.get('public_name', 'Original')
                    if self._is_valid_url(download_url, video_id, '%s video' % source_name):
                        ext = (try_get(
                            source_file, lambda x: x['extension'],
                            compat_str) or determine_ext(
                            download_url, None) or 'mp4').lower()
                        return {
                            'url': download_url,
                            'ext': ext,
                            'width': int_or_none(source_file.get('width')),
                            'height': int_or_none(source_file.get('height')),
                            'filesize': parse_filesize(source_file.get('size')),
                            'format_id': source_name,
                            'quality': 1,
                        }

        jwt_response = self._download_json(
            'https://vimeo.com/_rv/viewer', video_id, note='Downloading jwt token', fatal=False) or {}
        if not jwt_response.get('jwt'):
            return
        headers = {'Authorization': 'jwt %s' % jwt_response['jwt']}
        original_response = self._download_json(
            f'https://api.vimeo.com/videos/{video_id}', video_id,
            headers=headers, fatal=False) or {}
        for download_data in original_response.get('download') or {}:
            download_url = download_data.get('link')
            if not download_url or download_data.get('quality') != 'source':
                continue
            query = compat_urlparse.parse_qs(compat_urlparse.urlparse(download_url).query)
            return {
                'url': download_url,
                'ext': determine_ext(query.get('filename', [''])[0].lower()),
                'format_id': download_data.get('public_name', 'Original'),
                'width': int_or_none(download_data.get('width')),
                'height': int_or_none(download_data.get('height')),
                'fps': int_or_none(download_data.get('fps')),
                'filesize': int_or_none(download_data.get('size')),
                'quality': 1,
            }


class VimeoIE(VimeoBaseInfoExtractor):
    """Information extractor for vimeo.com."""

    # _VALID_URL matches Vimeo URLs
    _VALID_URL = r'''(?x)
                    https?://
                        (?:
                            (?:
                                www|
                                player