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?
optional
nsig_sc:string
Defined in
player_id
player_id:
string
Defined in
po_token?
optional
po_token:string
Defined in
sig_sc?
optional
sig_sc:string
Defined in
sts
sts:
number
Defined in
Accessors
url
get
url():string
Returns
string
Defined in
LIBRARY_VERSION
get
static
LIBRARY_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()
static
create(cache
,fetch
,po_token
?):Promise
<Player
>
Parameters
• cache: undefined
| ICache
• fetch = Platform.shim.fetch
• po_token?: string
Returns
Promise
<Player
>
Defined in
extractNSigSourceCode()
static
extractNSigSourceCode(data
):undefined
|string
Parameters
• data: string
Returns
undefined
| string
Defined in
extractSigSourceCode()
static
extractSigSourceCode(data
):string
Parameters
• data: string
Returns
string
Defined in
extractSigTimestamp()
static
extractSigTimestamp(data
):number
Parameters
• data: string
Returns
number
Defined in
fromCache()
static
fromCache(cache
,player_id
):Promise
<null
|Player
>
Parameters
• cache: ICache
• player_id: string
Returns
Promise
<null
| Player
>
Defined in
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
>