mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 09:01:43 +00:00
[youtube] Fix authentication when using multiple accounts
`SESSION_INDEX` in `ytcfg` is the index of the active account and should be sent as `X-Goog-AuthUser` header Closes #518 Authored by @colethedj
This commit is contained in:
parent
ccc7795ca3
commit
34917076ad
@ -533,7 +533,9 @@ def _generate_api_headers(self, ytcfg=None, identity_token=None, account_syncid=
|
|||||||
headers['X-Youtube-Identity-Token'] = identity_token
|
headers['X-Youtube-Identity-Token'] = identity_token
|
||||||
if account_syncid:
|
if account_syncid:
|
||||||
headers['X-Goog-PageId'] = account_syncid
|
headers['X-Goog-PageId'] = account_syncid
|
||||||
headers['X-Goog-AuthUser'] = 0
|
session_index = try_get(ytcfg, lambda x: x['SESSION_INDEX'], compat_str)
|
||||||
|
if account_syncid or session_index:
|
||||||
|
headers['X-Goog-AuthUser'] = session_index or 0
|
||||||
if visitor_data:
|
if visitor_data:
|
||||||
headers['X-Goog-Visitor-Id'] = visitor_data
|
headers['X-Goog-Visitor-Id'] = visitor_data
|
||||||
auth = self._generate_sapisidhash_header(origin)
|
auth = self._generate_sapisidhash_header(origin)
|
||||||
|
Loading…
Reference in New Issue
Block a user