youtubei.js / Player
Class: Player
Defined in: src/core/Player.ts:37
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:40
Parameters
player_id
string
signature_timestamp
number
data?
Returns
Player
Properties
data?
optionaldata:BuildScriptResult
Defined in: src/core/Player.ts:40
player_id
player_id:
string
Defined in: src/core/Player.ts:40
po_token?
optionalpo_token:string
Defined in: src/core/Player.ts:38
signature_timestamp
signature_timestamp:
number
Defined in: src/core/Player.ts:40
Accessors
url
Get Signature
get url():
string
Defined in: src/core/Player.ts:284
Returns
string
LIBRARY_VERSION
Get Signature
get
staticLIBRARY_VERSION():number
Defined in: src/core/Player.ts:288
Returns
number
Methods
cache()
cache(
cache?):Promise<void>
Defined in: src/core/Player.ts:270
Parameters
cache?
Returns
Promise<void>
decipher()
decipher(
url?,signature_cipher?,cipher?,this_response_nsig_cache?):Promise<string>
Defined in: src/core/Player.ts:134
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:42
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:243
Parameters
cache
player_id
string
Returns
Promise<Player | null>
fromSource()
staticfromSource(player_id,options):Promise<Player>
Defined in: src/core/Player.ts:264
Parameters
player_id
string
options
PlayerInitializationOptions
Returns
Promise<Player>