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

Code before:
                                mso_info['username_field']: username,
                                mso_info['password_field']: password,
                            })
                        saml_login_page, urlh = saml_login_page_res
                        if 'Please try again.' in saml_login_page:
                            raise ExtractorError(
                                'We\'re sorry, but either the User ID or Password entered is not correct.')
                    else:
                        # elif 'Please wait ...' in provider_redirect_page and "'N'== \"Y\"" in provider_redirect_page:
                        # ABC from non-Verizon IP
                        saml_redirect_url = self._html_search_regex(
                            r'var\surl\s*=\s*(["\'])(?P<url>.+?)\1',
                            provider_redirect_page,
                            'SAML Redirect URL', group='url')
                        saml_redirect_url = saml_redirect_url.replace(r'\/', '/')
                        saml_redirect_url = saml_redirect_url.replace(r'\-', '-')
                        saml_redirect_url = saml_redirect_url.replace(r'\x26', '&')
                        saml_login_page = self._download_webpage(
                            saml_redirect_url, video_id,
                            'Downloading SAML Login Page')
                        saml_login_page_res = post_form(
                            [saml_login_page, saml_redirect_url], 'Logging in', {
                                mso_info['username_field']: username,
                                mso_info['password_field']: password,
                            })
                        saml_login_page, urlh = saml_login_page_res
                        if 'Please try again.' in saml_login_page:
                            raise ExtractorError(
                                'We\'re sorry, but either the User ID or Password entered is not correct.')
                    saml_login_url = self._search_regex(
                        r'xmlHttp\.open\("POST"\s*,\s*(["\'])(?P<url>.+?)\1',
                        saml_login_page, 'SAML Login URL', group='url')
                    saml_response_json = self._download_json(
                        saml_login_url, video_id, 'Downloading SAML Response',
                        headers={'Content-Type': 'text/xml'})
                    self._download_webpage(
                        saml_response_json['targetValue'], video_id,
                        'Confirming Login', data=urlencode_postdata({
                            'SAMLResponse': saml_response_json['SAMLResponse'],
                            'RelayState': saml_response_json['RelayState']
                        }), headers={
                            'Content-Type': 'application/x-www-form-urlencoded'
                        })
                elif mso_id == 'Spectrum':
                    # Spectrum's login for is dynamically loaded via JS so we need to hardcode the flow
                    # as a one-off implementation.
                    provider_redirect_page, urlh = provider_redirect_page_res
                    provider_login_page_res = post_form(
                        provider_redirect_page_res, self._DOWNLOADING_LOGIN_PAGE)
                    saml_login_page, urlh = provider_login_page_res
                    relay_state = self._search_regex(

Review comment (suggestion):
```suggestion
                        saml_login_page, urlh = post_form(
                            [saml_login_page, saml_redirect_url], 'Logging in', {
                                mso_info['username_field']: username,
                                mso_info['password_field']: password,
                            })
```

Code after:
                                mso_info['username_field']: username,
                                mso_info['password_field']: password,
                            })
                        saml_login_page, urlh = saml_login_page_res
                        if 'Please try again.' in saml_login_page:
                            raise ExtractorError(
                                'We\'re sorry, but either the User ID or Password entered is not correct.')
                    else:
                        # ABC from non-Verizon IP
                        saml_redirect_url = self._html_search_regex(
                            r'var\surl\s*=\s*(["\'])(?P<url>.+?)\1',
                            provider_redirect_page,
                            'SAML Redirect URL', group='url')
                        saml_redirect_url = saml_redirect_url.replace(r'\/', '/')
                        saml_redirect_url = saml_redirect_url.replace(r'\-', '-')
                        saml_redirect_url = saml_redirect_url.replace(r'\x26', '&')
                        saml_login_page = self._download_webpage(
                            saml_redirect_url, video_id,
                            'Downloading SAML Login Page')
                        saml_login_page, urlh = post_form(
                            [saml_login_page, saml_redirect_url], 'Logging in', {
                                mso_info['username_field']: username,
                                mso_info['password_field']: password,
                            })
                        if 'Please try again.' in saml_login_page:
                            raise ExtractorError(
                                'Failed to login, incorrect User ID or Password.')
                    saml_login_url = self._search_regex(
                        r'xmlHttp\.open\("POST"\s*,\s*(["\'])(?P<url>.+?)\1',
                        saml_login_page, 'SAML Login URL', group='url')
                    saml_response_json = self._download_json(
                        saml_login_url, video_id, 'Downloading SAML Response',
                        headers={'Content-Type': 'text/xml'})
                    self._download_webpage(
                        saml_response_json['targetValue'], video_id,
                        'Confirming Login', data=urlencode_postdata({
                            'SAMLResponse': saml_response_json['SAMLResponse'],
                            'RelayState': saml_response_json['RelayState']
                        }), headers={
                            'Content-Type': 'application/x-www-form-urlencoded'
                        })
                elif mso_id == 'Spectrum':
                    # Spectrum's login for is dynamically loaded via JS so we need to hardcode the flow
                    # as a one-off implementation.
                    provider_redirect_page, urlh = provider_redirect_page_res
                    provider_login_page_res = post_form(
                        provider_redirect_page_res, self._DOWNLOADING_LOGIN_PAGE)
                    saml_login_page, urlh = provider_login_page_res
                    relay_state = self._search_regex(
                        r'RelayState\s*=\s*"(?P<relay>.+?)";',
                        saml_login_page, 'RelayState', group='relay')