Files
YouTube.js/examples/comments
LuanRT dca61c3a22 feat: finalize comment section nodes (#280)
* fix: comment translation proto missing channel id

* feat: finalize nodes

* docs: update API ref

* chore: update tests
2023-01-09 08:14:31 -03:00
..

Comments

YouTube.js has full support for comments, including comment actions such as translating, liking, disliking and replying.

Usage

Get a Comments instance:

const comments = await yt.getComments(VIDEO_ID);

API

contents

A list of comment threads. Note: More about comment threads here.

Type: CommentThread[]

applySort(sort)

Sorts the comments with the given sort type.

Param Type Description
sort string Sort type. Can be TOP_COMMENTS, NEWEST_FIRST

Returns: Promise.<Comments>

createComment(text)

Creates a top-level comment.

Param Type Description
text string Comment content

Returns: Promise<ActionsResponse>

getContinuation()

Retrieves next batch of comment threads.

Returns: Promise.<Comments>

has_continuation

Returns whether there are more comments to be fetched.

Type: boolean

page

Returns original InnerTube response (sanitized).

Returns: ParsedResponse

Example

See index.ts.