This commit is contained in:
coletdjnz 2024-09-14 13:29:52 +12:00
parent da9490259a
commit 08f40e890b
No known key found for this signature in database
GPG key ID: 91984263BB39894A

View file

@ -603,7 +603,6 @@ def _perform_login(self, username, password):
self._initialize_oauth(user, password) self._initialize_oauth(user, password)
_OAUTH_USER = None _OAUTH_USER = None
_OAUTH_REFRESH_TOKEN = None
_OAUTH_ACCESS_TOKEN_CACHE = {} _OAUTH_ACCESS_TOKEN_CACHE = {}
# YouTube TV (TVHTML5) client # YouTube TV (TVHTML5) client
@ -896,7 +895,7 @@ def _generate_cookie_auth_headers(self, *, ytcfg=None, account_syncid=None, sess
headers = {} headers = {}
account_syncid = account_syncid or self._extract_account_syncid(ytcfg) account_syncid = account_syncid or self._extract_account_syncid(ytcfg)
if account_syncid: if account_syncid:
headers['X-Goog-AuthUser'] = account_syncid headers['X-Goog-PageId'] = account_syncid
if session_index is None: if session_index is None:
session_index = self._extract_session_index(ytcfg) session_index = self._extract_session_index(ytcfg)
if account_syncid or session_index is not None: if account_syncid or session_index is not None:
@ -927,7 +926,6 @@ def generate_api_headers(
return filter_dict(headers) return filter_dict(headers)
def generate_webpage_headers(self, url): def generate_webpage_headers(self, url):
# Do not need to add cookie auth headers to webpage requests - surprise - it uses hte cookies instead
if not urllib.parse.urlparse(url).netloc.endswith('youtube.com'): if not urllib.parse.urlparse(url).netloc.endswith('youtube.com'):
return {} return {}
return self._generate_oauth_headers() return self._generate_oauth_headers()