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
Defined in
Properties
nsig_sc?
optionalnsig_sc:string
Defined in
player_id
player_id:
string
Defined in
po_token?
optionalpo_token:string
Defined in
sig_sc?
optionalsig_sc:string
Defined in
sts
sts:
number
Defined in
Accessors
url
geturl():string
Returns
string
Defined in
LIBRARY_VERSION
getstaticLIBRARY_VERSION():number
Returns
number
Defined in
Methods
cache()
cache(
cache?):Promise<void>
Parameters
• cache?: ICache
Returns
Promise<void>
Defined in
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
create()
staticcreate(cache,fetch,po_token?):Promise<Player>
Parameters
• cache: undefined | ICache
• fetch = Platform.shim.fetch
• po_token?: string
Returns
Promise<Player>
Defined in
extractNSigSourceCode()
staticextractNSigSourceCode(data):undefined|string
Parameters
• data: string
Returns
undefined | string
Defined in
extractSigSourceCode()
staticextractSigSourceCode(data):string
Parameters
• data: string
Returns
string
Defined in
extractSigTimestamp()
staticextractSigTimestamp(data):number
Parameters
• data: string
Returns
number
Defined in
fromCache()
staticfromCache(cache,player_id):Promise<null|Player>
Parameters
• cache: ICache
• player_id: string
Returns
Promise<null | Player>
Defined in
fromSource()
staticfromSource(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>