youtubei.js / OAuth2
Class: OAuth2
Constructors
new OAuth2()
new OAuth2(
session
):OAuth2
Parameters
• session: Session
Returns
Defined in
Properties
AUTH_SERVER_CODE_URL
AUTH_SERVER_CODE_URL:
URL
Defined in
AUTH_SERVER_REVOKE_TOKEN_URL
AUTH_SERVER_REVOKE_TOKEN_URL:
URL
Defined in
AUTH_SERVER_TOKEN_URL
AUTH_SERVER_TOKEN_URL:
URL
Defined in
client_id
client_id:
undefined
|OAuth2ClientID
Defined in
oauth2_tokens
oauth2_tokens:
undefined
|OAuth2Tokens
Defined in
YTTV_URL
YTTV_URL:
URL
Defined in
Methods
cacheCredentials()
cacheCredentials():
Promise
<void
>
Returns
Promise
<void
>
Defined in
getClientID()
getClientID():
Promise
<OAuth2ClientID
>
Returns
Promise
<OAuth2ClientID
>
Defined in
getDeviceAndUserCode()
getDeviceAndUserCode():
Promise
<DeviceAndUserCode
>
Returns
Promise
<DeviceAndUserCode
>
Defined in
init()
init(
tokens
?):Promise
<void
>
Parameters
• tokens?: OAuth2Tokens
Returns
Promise
<void
>
Defined in
pollForAccessToken()
pollForAccessToken(
device_and_user_code
):Promise
<void
>
Parameters
• device_and_user_code: DeviceAndUserCode
Returns
Promise
<void
>
Defined in
refreshAccessToken()
refreshAccessToken():
Promise
<void
>
Returns
Promise
<void
>
Defined in
removeCache()
removeCache():
Promise
<void
>
Returns
Promise
<void
>
Defined in
revokeCredentials()
revokeCredentials():
Promise
<undefined
|Response
>
Returns
Promise
<undefined
| Response
>
Defined in
setTokens()
setTokens(
tokens
):void
Parameters
• tokens: OAuth2Tokens
Returns
void
Defined in
shouldRefreshToken()
shouldRefreshToken():
boolean
Returns
boolean
Defined in
validateTokens()
validateTokens(
tokens
):boolean
Parameters
• tokens: OAuth2Tokens
Returns
boolean