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

Code before:
                        query=hidden_data)

                    provider_login_url = "https://authorize.suddenlink.net/saml/module.php/authSynacor/login.php" + "?AuthState=" + provider_tryauth_page
                    provider_login_page_res = self._download_webpage_handle(
                        provider_login_url, video_id, 'Getting Login Page.',
                        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)
                    hidden_data['history_val'] = 3

                    mvpd_confirm_page_res = self._download_webpage_handle(
                        urlh.geturl(), video_id, 'Sending Final Bookend.',
                        query=hidden_data)

                    post_form(mvpd_confirm_page_res, 'Confirming Login')
                else:
                    # Some providers (e.g. DIRECTV NOW) have another meta refresh
                    # based redirect that should be followed.
                    provider_redirect_page, urlh = provider_redirect_page_res
                    provider_refresh_redirect_url = extract_redirect_url(
                        provider_redirect_page, url=urlh.geturl())
                    if provider_refresh_redirect_url:
                        provider_redirect_page_res = self._download_webpage_handle(
                            provider_refresh_redirect_url, video_id,
                            'Downloading Provider Redirect Page (meta refresh)')
                    provider_login_page_res = post_form(
                        provider_redirect_page_res, self._DOWNLOADING_LOGIN_PAGE)
                    form_data = {
                        mso_info.get('username_field', 'username'): username,
                        mso_info.get('password_field', 'password'): password
                    }
                    if mso_id == 'Cablevision':
                        form_data['_eventId_proceed'] = ''
                    mvpd_confirm_page_res = post_form(provider_login_page_res, 'Logging in', form_data)
                    if mso_id != 'Rogers':
                        post_form(mvpd_confirm_page_res, 'Confirming Login')

                session = self._download_webpage(

Review comment (security):
```suggestion
                    provider_login_redirect_page, urlh = self._download_webpage_handle(
                        urlh.geturl(), video_id, 'Sending First Bookend',
                        query=hidden_data)

                    provider_tryauth_url = self._html_search_regex(
                        r'url:\s*[\'"]([^\'"]+)', provider_login_redirect_page, 'ajaxurl')

                    provider_tryauth_page, urlh = self._download_webpage_handle(
                        provider_tryauth_url, video_id, 'Submitting TryAuth',
                        query=hidden_data)

                    provider_login_url = f'https://authorize.suddenlink.net/saml/module.php/authSynacor/login.php?AuthState={provider_tryauth_page}'
                    provider_login_page_res = self._download_webpage_handle(
                        provider_login_url, video_id, 'Getting Login Page.',
                        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)
                    hidden_data['history_val'] = 3

                    mvpd_confirm_page_res = self._download_webpage_handle(
                        urlh.geturl(), video_id, 'Sending Final Bookend',
                        query=hidden_data)
```

Code after:
                        video_id, 'Getting Login Page',
                        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)
                    hidden_data['history_val'] = 3

                    mvpd_confirm_page_res = self._download_webpage_handle(
                        urlh.geturl(), video_id, 'Sending Final Bookend',
                        query=hidden_data)

                    post_form(mvpd_confirm_page_res, 'Confirming Login')
                else:
                    # Some providers (e.g. DIRECTV NOW) have another meta refresh
                    # based redirect that should be followed.
                    provider_redirect_page, urlh = provider_redirect_page_res
                    provider_refresh_redirect_url = extract_redirect_url(
                        provider_redirect_page, url=urlh.geturl())
                    if provider_refresh_redirect_url:
                        provider_redirect_page_res = self._download_webpage_handle(
                            provider_refresh_redirect_url, video_id,
                            'Downloading Provider Redirect Page (meta refresh)')
                    provider_login_page_res = post_form(
                        provider_redirect_page_res, self._DOWNLOADING_LOGIN_PAGE)
                    form_data = {
                        mso_info.get('username_field', 'username'): username,
                        mso_info.get('password_field', 'password'): password
                    }
                    if mso_id == 'Cablevision':
                        form_data['_eventId_proceed'] = ''
                    mvpd_confirm_page_res = post_form(provider_login_page_res, 'Logging in', form_data)
                    if mso_id != 'Rogers':
                        post_form(mvpd_confirm_page_res, 'Confirming Login')

                session = self._download_webpage(
                    self._SERVICE_PROVIDER_TEMPLATE % 'session', video_id,
                    'Retrieving Session', data=urlencode_postdata({
                        '_method': 'GET',
                        'requestor_id': requestor_id,