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

Code before:
            'timestamp': 1721373980,
            'license': 'by-sa',
            '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',
    }]
    _IFRAME_RE = r'<iframe[^>]+data-src\s*?=\s*?([\'"])(?P<url>https://germanupa\.de/media/oembed\?url=(?:(?!\1).)+)\1'
    _LOGIN_REQUIRED_RE = r'<div[^>]+class\s*?=\s*?([\'"])(?:(?!\1).)*login-wrapper(?:(?!\1).)*\1'

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

        embed_url = self._search_regex(self._IFRAME_RE, webpage, 'embed video', None, group='url')
        if not embed_url:
            return self.url_result(url, 'Generic')  # Fall back to generic to extract audio

        param_url = traverse_obj(parse_qs(embed_url), ('url', 0))
        if not param_url:
            if self._search_regex(self._LOGIN_REQUIRED_RE, webpage, 'login wrapper', default=None):
                self.raise_login_required('This video is only available for members')
            return self.url_result(url)  # Fall back

        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
        param_url = traverse_obj(parse_qs(embed_url), ('url', 0, {url_or_none}))
```

Code after:
            'uploader_url': 'https://vimeo.com/germanupa',
            'timestamp': 1721373980,
            'license': 'by-sa',
            '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)