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

Code before:
            'like_count': int,
            'thumbnail': 'https://i.vimeocdn.com/video/1904187064-2a672630c30f9ad787bd390bff3f51d7506a3e8416763ba6dbf465732b165c5c-d_1280',
            'duration': 2146,
            'release_timestamp': 1721373980,
            'uploader': 'German UPA',
            'uploader_id': 'germanupa',
            'upload_date': '20240719',
            'comment_count': int,
        },
        'expected_warnings': ['Failed to parse XML: not well-formed'],
        'skip': 'login required',
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)

        param_url = traverse_obj(
            self._search_regex(
                r'<iframe[^>]+data-src\s*?=\s*?([\'"])(?P<url>https://germanupa\.de/media/oembed\?url=(?:(?!\1).)+)\1',
                webpage, 'embedded video', None, group='url'),
            ({parse_qs}, 'url', 0, {url_or_none}))

        if not param_url:
            if self._search_regex(r'<div[^>]+class\s*?=\s*?([\'"])(?:(?!\1).)*login-wrapper(?:(?!\1).)*\1',
                                  webpage, 'login wrapper', None):
                self.raise_login_required('This video is only available for members')
            return self.url_result(url, 'Generic')  # Fall back to generic to extract audio

        real_url = param_url.replace('https://vimeo.com/', 'https://player.vimeo.com/video/')
        return self.url_result(VimeoIE._smuggle_referrer(real_url, url), VimeoIE, video_id)


Review comment (suggestion):
```suggestion
            if self._search_regex(
                    r'<div[^>]+class\s*?=\s*?([\'"])(?:(?!\1).)*login-wrapper(?:(?!\1).)*\1',
                    webpage, 'login wrapper', default=None):
```

Code after:
            'like_count': int,
            'thumbnail': 'https://i.vimeocdn.com/video/1904187064-2a672630c30f9ad787bd390bff3f51d7506a3e8416763ba6dbf465732b165c5c-d_1280',
            'duration': 2146,
            'release_timestamp': 1721373980,
            'uploader': 'German UPA',
            'uploader_id': 'germanupa',
            'upload_date': '20240719',
            'comment_count': int,
        },
        'expected_warnings': ['Failed to parse XML: not well-formed'],
        'skip': 'login required',
    }]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)

        param_url = traverse_obj(
            self._search_regex(
                r'<iframe[^>]+data-src\s*?=\s*?([\'"])(?P<url>https://germanupa\.de/media/oembed\?url=(?:(?!\1).)+)\1',
                webpage, 'embedded video', default=None, group='url'),
            ({parse_qs}, 'url', 0, {url_or_none}))

        if not param_url:
            if self._search_regex(
                    r'<div[^>]+class\s*?=\s*?([\'"])(?:(?!\1).)*login-wrapper(?:(?!\1).)*\1',
                    webpage, 'login wrapper', default=None):
                self.raise_login_required('This video is only available for members')
            return self.url_result(url, 'Generic')  # Fall back to generic to extract audio

        real_url = param_url.replace('https://vimeo.com/', 'https://player.vimeo.com/video/')
        return self.url_result(VimeoIE._smuggle_referrer(real_url, url), VimeoIE, video_id)