Add X-Youtube-Bootstrap-Logged-In logic

This commit is contained in:
coletdjnz 2025-01-04 12:45:52 +13:00
parent 5090388b73
commit a986b82482
No known key found for this signature in database
GPG key ID: 91984263BB39894A

View file

@ -831,6 +831,9 @@ def _generate_cookie_auth_headers(self, *, ytcfg=None, account_syncid=None, sess
headers['Authorization'] = auth
headers['X-Origin'] = origin
if traverse_obj(ytcfg, 'LOGGED_IN', expected_type=bool):
headers['X-Youtube-Bootstrap-Logged-In'] = 'true'
return headers
def generate_api_headers(
@ -3909,7 +3912,7 @@ def _extract_player_response(self, client, video_id, master_ytcfg, player_ytcfg,
visitor_data=visitor_data,
session_index=self._extract_session_index(master_ytcfg, player_ytcfg),
account_syncid=(
self._parse_data_sync_id(data_sync_id)
self._parse_data_sync_id(data_sync_id)[0]
or self._extract_delegated_session_id(master_ytcfg, initial_pr, player_ytcfg)
),
)