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

Code before:
            elif i_type == 'post_tag':
                info.setdefault('tags', []).append(traverse_obj(i, ('attributes', 'value')))

            elif i_type == 'campaign':
                info.update({
                    'channel': traverse_obj(i, ('attributes', 'title')),
                    'channel_id': str_or_none(i.get('id')),
                    'channel_url': traverse_obj(i, ('attributes', 'url')),
                    'channel_follower_count': int_or_none(traverse_obj(i, ('attributes', 'patron_count'))),
                })

        # handle Vimeo embeds
        if try_get(attributes, lambda x: x['embed']['provider']) == 'Vimeo':
            embed_html = try_get(attributes, lambda x: x['embed']['html'])
            v_url = url_or_none(compat_urllib_parse_unquote(
                self._search_regex(r'(https(?:%3A%2F%2F|://)player\.vimeo\.com.+app_id(?:=|%3D)+\d+)', embed_html, 'vimeo url', fatal=False)))
            if v_url:
                v_url = VimeoIE._smuggle_referrer(v_url, 'https://patreon.com')

                if self._request_webpage(v_url, video_id, 'Checking Vimeo embed URL', fatal=False, errnote=False):
                    return {
                        **info,
                        '_type': 'url_transparent',
                        'url': v_url,
                        'ie_key': 'Vimeo',
                    }

        embed_url = try_get(attributes, lambda x: x['embed']['url'])
        if embed_url:
            if self._request_webpage(embed_url, video_id, 'Checking embed URL', fatal=False, errnote=False):
                return {
                    **info,
                    '_type': 'url',
                    'url': embed_url,
                }

        post_file = traverse_obj(attributes, 'post_file')
        if post_file:
            name = post_file.get('name')
            ext = determine_ext(name)
            if ext in KNOWN_EXTENSIONS:
                return {
                    **info,
                    'ext': ext,
                    'url': post_file['url'],
                }
            elif name == 'video' or determine_ext(post_file.get('url')) == 'm3u8':
                formats, subtitles = self._extract_m3u8_formats_and_subtitles(post_file['url'], video_id)
                return {
                    **info,
                    'formats': formats,

Review comment (suggestion):
maybe this should be
```suggestion
                    return self.url_result(v_url, 'Vimeo', **info, url_transparent=True)
```

Code after:
                download_url = media_attributes.get('download_url')
                ext = mimetype2ext(media_attributes.get('mimetype'))

                # if size_bytes is None, this media file is likely unavailable
                # See: https://github.com/yt-dlp/yt-dlp/issues/4608
                size_bytes = int_or_none(media_attributes.get('size_bytes'))
                if download_url and ext in KNOWN_EXTENSIONS and size_bytes is not None:
                    # XXX: what happens if there are multiple attachments?
                    return {
                        **info,
                        'ext': ext,
                        'filesize': size_bytes,
                        'url': download_url,
                    }
            elif i_type == 'user':
                user_attributes = i.get('attributes')
                if user_attributes:
                    info.update({
                        'uploader': user_attributes.get('full_name'),
                        'uploader_id': str_or_none(i.get('id')),
                        'uploader_url': user_attributes.get('url'),
                    })

            elif i_type == 'post_tag':
                info.setdefault('tags', []).append(traverse_obj(i, ('attributes', 'value')))

            elif i_type == 'campaign':
                info.update({
                    'channel': traverse_obj(i, ('attributes', 'title')),
                    'channel_id': str_or_none(i.get('id')),
                    'channel_url': traverse_obj(i, ('attributes', 'url')),
                    'channel_follower_count': int_or_none(traverse_obj(i, ('attributes', 'patron_count'))),
                })

        # handle Vimeo embeds
        if try_get(attributes, lambda x: x['embed']['provider']) == 'Vimeo':
            embed_html = try_get(attributes, lambda x: x['embed']['html'])
            v_url = url_or_none(compat_urllib_parse_unquote(
                self._search_regex(r'(https(?:%3A%2F%2F|://)player\.vimeo\.com.+app_id(?:=|%3D)+\d+)', embed_html, 'vimeo url', fatal=False)))
            if v_url:
                v_url = VimeoIE._smuggle_referrer(v_url, 'https://patreon.com')
                if self._request_webpage(v_url, video_id, 'Checking Vimeo embed URL', fatal=False, errnote=False):
                    return self.url_result(v_url, VimeoIE, url_transparent=True, **info)

        embed_url = try_get(attributes, lambda x: x['embed']['url'])
        if embed_url and self._request_webpage(embed_url, video_id, 'Checking embed URL', fatal=False, errnote=False):
            return self.url_result(embed_url, **info)

        post_file = traverse_obj(attributes, 'post_file')
        if post_file:
            name = post_file.get('name')