diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 776d20e34..838e6de1f 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -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) ), )