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

Code before:
                        r'SAMLRequest\s*=\s*"(?P<saml_request>.+?)";',
                        saml_login_page, 'SAMLRequest', group='saml_request')
                    login_json = {
                        mso_info['username_field']: username,
                        mso_info['password_field']: password,
                        'RelayState': relay_state,
                        'SAMLRequest': saml_request,
                    }
                    saml_response_json = self._download_json(
                        'https://tveauthn.spectrum.net/tveauthentication/api/v1/manualAuth', video_id,
                        'Downloading SAML Response',
                        data=json.dumps(login_json).encode(),
                        headers={
                            'Content-Type': 'application/json',
                            'Accept': 'application/json',
                        })
                    self._download_webpage(
                        saml_response_json['SAMLRedirectUri'], video_id,
                        'Confirming Login', data=urlencode_postdata({
                            'SAMLResponse': saml_response_json['SAMLResponse'],
                            'RelayState': relay_state,
                        }), headers={
                            'Content-Type': 'application/x-www-form-urlencoded'
                        })
                elif mso_id == 'slingtv':
                    # SlingTV  has a meta-refresh based authentication, but also
                    # looks at the tab history to count the number of times the
                    # browser has been on a page

                    first_bookend_page, urlh = provider_redirect_page_res

                    hidden_data = self._hidden_inputs(first_bookend_page)
                    hidden_data['history'] = 1

                    provider_login_page_res = self._download_webpage_handle(
                        urlh.geturl(), video_id, 'Sending first bookend.',
                        query=hidden_data)

                    provider_association_redirect, urlh = post_form(
                        provider_login_page_res,  'Logging in', {
                            mso_info['username_field']: username,
                            mso_info['password_field']: password
                        })

                    provider_refresh_redirect_url = extract_redirect_url(
                        provider_association_redirect, url=urlh.geturl())

                    last_bookend_page, urlh = self._download_webpage_handle(
                        provider_refresh_redirect_url, video_id,
                        'Downloading Auth Association Redirect Page')
                    hidden_data = self._hidden_inputs(last_bookend_page)

Review comment (security):
```suggestion
                    # SlingTV has a meta-refresh based authentication, but also
```

Code after:
                        r'SAMLRequest\s*=\s*"(?P<saml_request>.+?)";',
                        saml_login_page, 'SAMLRequest', group='saml_request')
                    login_json = {
                        mso_info['username_field']: username,
                        mso_info['password_field']: password,
                        'RelayState': relay_state,
                        'SAMLRequest': saml_request,
                    }
                    saml_response_json = self._download_json(
                        'https://tveauthn.spectrum.net/tveauthentication/api/v1/manualAuth', video_id,
                        'Downloading SAML Response',
                        data=json.dumps(login_json).encode(),
                        headers={
                            'Content-Type': 'application/json',
                            'Accept': 'application/json',
                        })
                    self._download_webpage(
                        saml_response_json['SAMLRedirectUri'], video_id,
                        'Confirming Login', data=urlencode_postdata({
                            'SAMLResponse': saml_response_json['SAMLResponse'],
                            'RelayState': relay_state,
                        }), headers={
                            'Content-Type': 'application/x-www-form-urlencoded'
                        })
                elif mso_id == 'slingtv':
                    # SlingTV has a meta-refresh based authentication, but also
                    # looks at the tab history to count the number of times the
                    # browser has been on a page

                    first_bookend_page, urlh = provider_redirect_page_res

                    hidden_data = self._hidden_inputs(first_bookend_page)
                    hidden_data['history'] = 1

                    provider_login_page_res = self._download_webpage_handle(
                        urlh.geturl(), video_id, 'Sending first bookend.',
                        query=hidden_data)

                    provider_association_redirect, urlh = post_form(
                        provider_login_page_res, 'Logging in', {
                            mso_info['username_field']: username,
                            mso_info['password_field']: password
                        })

                    provider_refresh_redirect_url = extract_redirect_url(
                        provider_association_redirect, url=urlh.geturl())

                    last_bookend_page, urlh = self._download_webpage_handle(
                        provider_refresh_redirect_url, video_id,
                        'Downloading Auth Association Redirect Page')
                    hidden_data = self._hidden_inputs(last_bookend_page)