Files
YouTube.js/docs/api/namespaces/YT/classes/Comments.md
Luan 25d0876b91 refactor(Player)!: Use AST-based JS extraction with side-effect safe code emission (#1052)
* chore(deps): Add `meriyah`

* feat(utils): Implement AST-based JS extractors

* chore(utils): Remove old ast walker code

* fix(Player): Migrate js extraction logic

* chore(JsExtractor): Fix typo in tsdoc

* perf(JsAnalyzer): Simplify main AST analysis logic

* fix(JsAnalyzer): Change `break` to `return` in AST matching logic

* chore: Update docs

* chore: Don't export `PlayerInitializationOptions`

* chore(evaluate): Update error message to include doc link

* perf: Use a `for-loop` to find iife
2025-10-12 09:08:51 -03:00

3.0 KiB

youtubei.js / YT / Comments

Class: Comments

Constructors

new Comments()

new Comments(actions, data, already_parsed): Comments

Parameters

actions: Actions

data: any

already_parsed: boolean = false

Returns

Comments

Defined in

src/parser/youtube/Comments.ts:23

Properties

contents

contents: ObservedArray<CommentThread>

Defined in

src/parser/youtube/Comments.ts:21


header?

optional header: CommentsHeader

Defined in

src/parser/youtube/Comments.ts:20

Accessors

has_continuation

get has_continuation(): boolean

Returns

boolean

Defined in

src/parser/youtube/Comments.ts:117


page

get page(): INextResponse

Returns

INextResponse

Defined in

src/parser/youtube/Comments.ts:121

Methods

applySort()

applySort(sort): Promise<Comments>

Applies given sort option to the comments.

Parameters

sort: "TOP_COMMENTS" | "NEWEST_FIRST"

Sort type.

Returns

Promise<Comments>

Defined in

src/parser/youtube/Comments.ts:53


createComment()

createComment(text): Promise<ApiResponse>

Creates a top-level comment.

Parameters

text: string

Comment text.

Returns

Promise<ApiResponse>

Defined in

src/parser/youtube/Comments.ts:80


getContinuation()

getContinuation(): Promise<Comments>

Retrieves next batch of comments.

Returns

Promise<Comments>

Defined in

src/parser/youtube/Comments.ts:98