mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-20 04:51:16 +00:00
feat: add support for switching accounts (cookie based auth only) (#236)
* feat: add support for switching accounts * style: lint
This commit is contained in:
@@ -103,9 +103,12 @@ export default class HTTPClient {
|
||||
|
||||
if (this.#cookie) {
|
||||
const papisid = getStringBetweenStrings(this.#cookie, 'PAPISID=', ';');
|
||||
|
||||
if (papisid) {
|
||||
request_headers.set('authorization', await generateSidAuth(papisid));
|
||||
request_headers.set('x-goog-authuser', this.#session.account_index.toString());
|
||||
}
|
||||
|
||||
request_headers.set('cookie', this.#cookie);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user