youtubei.js / Player
Class: Player
Defined in: src/core/Player.ts:38
Represents YouTube's player script. This is required to decipher signatures.
Constructors
Constructor
new Player(
player_id,signature_timestamp,data?):Player
Defined in: src/core/Player.ts:41
Parameters
player_id
string
signature_timestamp
number
data?
Returns
Player
Properties
data?
optionaldata:BuildScriptResult
Defined in: src/core/Player.ts:41
player_id
player_id:
string
Defined in: src/core/Player.ts:41
po_token?
optionalpo_token:string
Defined in: src/core/Player.ts:39
signature_timestamp
signature_timestamp:
number
Defined in: src/core/Player.ts:41
Accessors
url
Get Signature
get url():
string
Defined in: src/core/Player.ts:285
Returns
string
LIBRARY_VERSION
Get Signature
get
staticLIBRARY_VERSION():number
Defined in: src/core/Player.ts:289
Returns
number
Methods
cache()
cache(
cache?):Promise<void>
Defined in: src/core/Player.ts:271
Parameters
cache?
Returns
Promise<void>
decipher()
decipher(
url?,signature_cipher?,cipher?,this_response_nsig_cache?):Promise<string>
Defined in: src/core/Player.ts:129
Parameters
url?
string
signature_cipher?
string
cipher?
string
this_response_nsig_cache?
Map<string, string>
Returns
Promise<string>
create()
staticcreate(cache,fetch?,po_token?,player_id?):Promise<Player>
Defined in: src/core/Player.ts:43
Parameters
cache
ICache | undefined
fetch?
{(input, init?): Promise<Response>; (input, init?): Promise<Response>; }
po_token?
string
player_id?
string
Returns
Promise<Player>
fromCache()
staticfromCache(cache,player_id):Promise<Player|null>
Defined in: src/core/Player.ts:244
Parameters
cache
player_id
string
Returns
Promise<Player | null>
fromSource()
staticfromSource(player_id,options):Promise<Player>
Defined in: src/core/Player.ts:265
Parameters
player_id
string
options
PlayerInitializationOptions
Returns
Promise<Player>