youtubei.js / YTNodes / Video
Class: Video
Defined in: src/parser/classes/Video.ts:13
Extends
Extended by
Constructors
Constructor
new Video(
data):Video
Defined in: src/parser/classes/Video.ts:43
Parameters
data
Returns
Video
Overrides
Properties
additional_metadatas?
optionaladditional_metadatas:Text[]
Defined in: src/parser/classes/Video.ts:22
author
author:
Author
Defined in: src/parser/classes/Video.ts:26
badges
badges:
ObservedArray<MetadataBadge>
Defined in: src/parser/classes/Video.ts:27
byline_text?
optionalbyline_text:Text
Defined in: src/parser/classes/Video.ts:37
description_snippet?
optionaldescription_snippet:Text
Defined in: src/parser/classes/Video.ts:19
endpoint?
optionalendpoint:NavigationEndpoint
Defined in: src/parser/classes/Video.ts:28
expandable_metadata
expandable_metadata:
ExpandableMetadata|null
Defined in: src/parser/classes/Video.ts:21
is_watched
is_watched:
boolean
Defined in: src/parser/classes/Video.ts:35
length_text?
optionallength_text:Text
Defined in: src/parser/classes/Video.ts:33
menu
menu:
Menu|null
Defined in: src/parser/classes/Video.ts:36
published?
optionalpublished:Text
Defined in: src/parser/classes/Video.ts:29
rich_thumbnail?
optionalrich_thumbnail:YTNode
Defined in: src/parser/classes/Video.ts:25
search_video_result_entity_key?
optionalsearch_video_result_entity_key:string
Defined in: src/parser/classes/Video.ts:38
service_endpoint?
optionalservice_endpoint:NavigationEndpoint
Defined in: src/parser/classes/Video.ts:40
service_endpoints?
optionalservice_endpoints:NavigationEndpoint[]
Defined in: src/parser/classes/Video.ts:39
short_view_count?
optionalshort_view_count:Text
Defined in: src/parser/classes/Video.ts:31
show_action_menu
show_action_menu:
boolean
Defined in: src/parser/classes/Video.ts:34
snippets?
optionalsnippets:object[]
Defined in: src/parser/classes/Video.ts:20
hover_text
hover_text:
Text
text
text:
Text
style?
optionalstyle:"VIDEO_STYLE_TYPE_UNKNOWN"|"VIDEO_STYLE_TYPE_NORMAL"|"VIDEO_STYLE_TYPE_POST"|"VIDEO_STYLE_TYPE_SUB"|"VIDEO_STYLE_TYPE_LIVE_POST"|"VIDEO_STYLE_TYPE_FULL_BLEED_ISOLATED"|"VIDEO_STYLE_TYPE_WITH_EXPANDED_METADATA"
Defined in: src/parser/classes/Video.ts:41
thumbnail_overlays
thumbnail_overlays:
ObservedArray<YTNode>
Defined in: src/parser/classes/Video.ts:24
thumbnails
thumbnails:
Thumbnail[]
Defined in: src/parser/classes/Video.ts:23
title
title:
Text
Defined in: src/parser/classes/Video.ts:17
type
readonlytype:string
Defined in: src/parser/helpers.ts:8
Inherited from
untranslated_title?
optionaluntranslated_title:Text
Defined in: src/parser/classes/Video.ts:18
upcoming?
optionalupcoming:Date
Defined in: src/parser/classes/Video.ts:32
video_id
video_id:
string
Defined in: src/parser/classes/Video.ts:16
view_count?
optionalview_count:Text
Defined in: src/parser/classes/Video.ts:30
type
statictype:string='Video'
Defined in: src/parser/classes/Video.ts:14
Overrides
Accessors
best_thumbnail
Get Signature
get best_thumbnail():
Thumbnail|undefined
Defined in: src/parser/classes/Video.ts:148
Returns
Thumbnail | undefined
description
Get Signature
get description():
string
Defined in: src/parser/classes/Video.ts:119
Returns
string
duration
Get Signature
get duration():
object
Defined in: src/parser/classes/Video.ts:152
Returns
object
seconds
seconds:
number
text
text:
string|undefined=length_text
has_captions
Get Signature
get has_captions():
boolean
Defined in: src/parser/classes/Video.ts:144
Returns
boolean
id
Get Signature
get id():
string
Defined in: src/parser/classes/Video.ts:115
Deprecated
Use video_id instead.
Returns
string
is_4k
Get Signature
get is_4k():
boolean
Defined in: src/parser/classes/Video.ts:140
Returns
boolean
is_live
Get Signature
get is_live():
boolean
Defined in: src/parser/classes/Video.ts:125
Returns
boolean
is_premiere
Get Signature
get is_premiere():
boolean
Defined in: src/parser/classes/Video.ts:136
Returns
boolean
is_upcoming
Get Signature
get is_upcoming():
boolean|undefined
Defined in: src/parser/classes/Video.ts:132
Returns
boolean | undefined
Methods
as()
as<
T,K>(...types):InstanceType<K[number]>
Defined in: src/parser/helpers.ts:29
Cast to one of the given types.
Type Parameters
T
T extends YTNode
K
K extends YTNodeConstructor<T>[]
Parameters
types
...K
The types to cast to
Returns
InstanceType<K[number]>
The node cast to one of the given types
Throws
If the node is not of the given type
Inherited from
hasKey()
hasKey<
T,R>(key):this is Video & { [k in string]: R }
Defined in: src/parser/helpers.ts:41
Check for a key without asserting the type.
Type Parameters
T
T extends string
R
R = any
Parameters
key
T
The key to check
Returns
this is Video & { [k in string]: R }
Whether the node has the key
Inherited from
is()
is<
T,K>(...types):this is InstanceType<K[number]>
Defined in: src/parser/helpers.ts:19
Check if the node is of the given type.
Type Parameters
T
T extends YTNode
K
K extends YTNodeConstructor<T>[]
Parameters
types
...K
The type to check
Returns
this is InstanceType<K[number]>
whether the node is of the given type
Inherited from
key()
key<
T,R>(key):Maybe
Defined in: src/parser/helpers.ts:51
Assert that the node has the given key and return it.
Type Parameters
T
T extends string
R
R = any
Parameters
key
T
The key to check
Returns
The value of the key wrapped in a Maybe
Throws
If the node does not have the key