YouTube.js
Guide
Discord
GitHub
Guide
Discord
GitHub

youtubei.js / Player

Class: Player

Represents YouTube's player script. This is required to decipher signatures.

Constructors

new Player()

new Player(player_id, signature_timestamp, sig_sc?, nsig_sc?): Player

Parameters

• player_id: string

• signature_timestamp: number

• sig_sc?: string

• nsig_sc?: string

Returns

Player

Defined in

src/core/Player.ts:26

Properties

nsig_sc?

optional nsig_sc: string

Defined in

src/core/Player.ts:22


player_id

player_id: string

Defined in

src/core/Player.ts:20


po_token?

optional po_token: string

Defined in

src/core/Player.ts:24


sig_sc?

optional sig_sc: string

Defined in

src/core/Player.ts:23


sts

sts: number

Defined in

src/core/Player.ts:21

Accessors

url

get url(): string

Returns

string

Defined in

src/core/Player.ts:324


LIBRARY_VERSION

get static LIBRARY_VERSION(): number

Returns

number

Defined in

src/core/Player.ts:328

Methods

cache()

cache(cache?): Promise<void>

Parameters

• cache?: ICache

Returns

Promise<void>

Defined in

src/core/Player.ts:218


decipher()

decipher(url?, signature_cipher?, cipher?, this_response_nsig_cache?): string

Parameters

• url?: string

• signature_cipher?: string

• cipher?: string

• this_response_nsig_cache?: Map<string, string>

Returns

string

Defined in

src/core/Player.ts:93


create()

static create(cache, fetch, po_token?, player_id?): Promise<Player>

Parameters

• cache: undefined | ICache

• fetch = Platform.shim.fetch

• po_token?: string

• player_id?: string

Returns

Promise<Player>

Defined in

src/core/Player.ts:33


extractGlobalVariable()

static extractGlobalVariable(data, ast): undefined | ASTLookupResult

Parameters

• data: string

• ast: ExtendNode<Program>

Returns

undefined | ASTLookupResult

Defined in

src/core/Player.ts:244


extractNSigSourceCode()

static extractNSigSourceCode(data, ast?, global_variable?): undefined | string

Parameters

• data: string

• ast?: ExtendNode<Program>

• global_variable?: ASTLookupResult

Returns

undefined | string

Defined in

src/core/Player.ts:292


extractSigSourceCode()

static extractSigSourceCode(data, global_variable?): undefined | string

Parameters

• data: string

• global_variable?: ASTLookupResult

Returns

undefined | string

Defined in

src/core/Player.ts:263


extractSigTimestamp()

static extractSigTimestamp(data): number

Parameters

• data: string

Returns

number

Defined in

src/core/Player.ts:240


fromCache()

static fromCache(cache, player_id): Promise<null | Player>

Parameters

• cache: ICache

• player_id: string

Returns

Promise<null | Player>

Defined in

src/core/Player.ts:188


fromSource()

static fromSource(player_id, sig_timestamp, cache?, sig_sc?, nsig_sc?): Promise<Player>

Parameters

• player_id: string

• sig_timestamp: number

• cache?: ICache

• sig_sc?: string

• nsig_sc?: string

Returns

Promise<Player>

Defined in

src/core/Player.ts:212

Edit this page
Last Updated:: 6/8/25, 5:43 PM
Contributors: Luan