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

Code before:
                    # extract the form data from the first bookend and re-send via GET
                    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)

                    # log in after being redirected
                    provider_redirect_post_login_res = post_form(provider_login_page_res, 'Logging in', {
                        mso_info.get('username_field', 'username'): username,
                        mso_info.get('password_field', 'password'): password,
                    })

                    provider_association_redirect, urlh = provider_redirect_post_login_res

                    # extract the redirect URL (executes with JS in the browser)
                    provider_refresh_redirect_url = extract_redirect_url(
                        provider_association_redirect, url=urlh.geturl())

                    # the redirected URL sends us to the final bookend page
                    last_bookend_page_res = self._download_webpage_handle(
                        provider_refresh_redirect_url, video_id,
                        'Downloading Auth Association Redirect Page (meta refresh)')

                    last_bookend_page, urlh = last_bookend_page_res

                    # extract the form data from the final page
                    hidden_data = self._hidden_inputs(last_bookend_page)
                    hidden_data['history'] = 3

                    # re-send via GET
                    mvpd_confirm_page_res = self._download_webpage_handle(
                        urlh.geturl(), video_id, 'Sending final bookend.', query=hidden_data)

                    # press the "button" to confirm login
                    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)
                    mvpd_confirm_page_res = post_form(provider_login_page_res, 'Logging in', {
                        mso_info.get('username_field', 'username'): username,
                        mso_info.get('password_field', 'password'): password,

Review comment (security):
```suggestion
                    last_bookend_page, urlh = self._download_webpage_handle(
                        provider_refresh_redirect_url, video_id,
                        'Downloading Auth Association Redirect Page')
```

Code after:
                        })

                    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'] = 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)
                    mvpd_confirm_page_res = post_form(provider_login_page_res, 'Logging in', {
                        mso_info.get('username_field', 'username'): username,
                        mso_info.get('password_field', 'password'): password,
                    })
                    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,
                    }), headers=mvpd_headers)
                if '<pendingLogout' in session:
                    self._downloader.cache.store(self._MVPD_CACHE, requestor_id, {})
                    count += 1
                    continue
                authn_token = unescapeHTML(xml_text(session, 'authnToken'))
                requestor_info['authn_token'] = authn_token
                self._downloader.cache.store(self._MVPD_CACHE, requestor_id, requestor_info)

            authz_token = requestor_info.get(guid)
            if authz_token and is_expired(authz_token, 'simpleTokenTTL'):