- Async Iterator API
mc.iter().filter().map()...
- New event type for Event Emitter API (
chat
)
membership
inAddMembershipMilestoneItemAction
andAddMembershipItemAction
now becomes optional and won't raise an error when membership information lacks in those actions
- Transcript API
mc.getTranscript()
- Playlist API
mc.getPlaylist()
- New:
ModerationMessageAction
(type:moderationMessageAction
) for moderation messages for moderators - New:
AddRedirectBannerAction
(type:addRedirectBannerAction
) for raid event notifications
- Move video comments API to Masterchat class
mc.getComments()
- Use direct method for
hide
,unhide
,pin
,unpin
,addModerator
,removeModerator
andtimeout
- Add
executor
toMarkChatItemAsDeletedAction
- Don't overwrite
isLive
unless it is undefined - Reintroduce timeout drift adjustment
- Treat
ERR_REQUEST_ABORTED
as aborted - Detect being timeouted by moderator when sending a chat
- Replace cross-fetch with axios (thanks for the review, @ricecakess)
- Ditch timeout adjustment for performance reasons
authorName
inaddMembershipItemAction
now becomes optional as we've got a report about such events (thanks @sphinxrave)
- New: Support for Video Comment API (see MANUAL):
getComments
for fetching video commentsgetComment
for fetching video comment by id
- New action:
MembershipGiftPurchaseAction
andMembershipGiftRedemptionAction
- New action:
AddPollResultAction
(separated fromAddViewerEngagementMessageAction
) - New params for
AddBannerAction
:viewerIsCreator
,targetId
- BREAKING: remove
messageType
fromAddViewerEngagementMessageAction
- BREAKING: normalize
ReplaceChatItemAction.replacementItem
interfaces - BREAKING: incompatible property name changes
AddBannerAction.id
which is actually action id has been renamed toAddBannerAction.actionId
AddBannerAction.id
now refer to chat id
- Move cli tools (
tools/
) tomasterchat-cli
- Properly handle membership tickers where its content are gift purchase actions
AddSuperChatItemAction.authorName
becomes optional (as we've observed such events)- Special handling for cases where addLiveChatItemAction is missing
message
- AddLiveChatItemAction.message now becomes optional (you can just ignore those anomalous events)
- Special handling for anomalous emoji entities
- New action:
AddMembershipMilestoneItemAction
. Refer toduration
for a precise membership duration - New action:
ShowPollPanelAction
. - Add
timestampColor
andauthorNameTextColor
toSuperChat
- New util
stringify
to transformYTRun[]
,YTRunContainer
andYTSimpleText
into string - New util
formatColor
to formatColor
into CSS rgba() or HEX string - New util
durationToISO8601
to format duration text into ISO8601 duration string - New util
durationToSeconds
to format duration text into integer seconds - New util
tsToDate
to format timestampUsec to Date - New util
tsToNumber
to format timestampUsec to number
- BREAKING: normalized all the raw interfaces:
AddBannerAction
AddMembershipItemAction
AddMembershipTickerAction
AddPlaceholderItemAction
AddSuperChatTickerAction
AddSuperStickerItemAction
AddSuperStickerTickerAction
AddViewerEngagementMessageAction
ClosePanelAction
ShowPanelAction
ShowTooltipAction
- BREAKING: renamed
ShowLiveChatActionPanelAction
->ShowPanelAction
- BREAKING: renamed
UpdateLiveChatPollAction
->UpdatePollAction
- BREAKING: renamed
CloseLiveChatActionPanelAction
->ClosePanelAction
- DEPRECATED:
AddChatItemAction.rawMessage
->AddChatItemAction.message
- DEPRECATED:
AddSuperChatItemAction.rawMessage
->AddSuperChatItemAction.message
- DEPRECATED: props of
AddSuperChatItemAction.superchat
has been flattened intoAddSuperChatItemAction
- BREAKING:
end
event will provide a reason ('privated' | 'deleted' | 'disabled' | 'aborted' | null
)streamPool.on('end', (mc) => {})
->streamPool.on('end', (reason, mc) => {})
- BREAKING: instance will emit
end
instead oferror
in some special cases where the unrecoverable error code is eitherprivate
orunavailable
, and it did not occur during the first request (this usually happens when a streamer deletes or privates their live stream after the stream ends) - BREAKING:
runsToPlainText
will expandwatchEndpoint
whentext
is a fragment of URL - use Uint8Array instead of Buffer in protobuf lib (by @jprochazk)
- BREAKING: remove
unknown
type fromMasterchatError
- Deprecate
Credentials.SESSION_ID
in favor ofCredentials.DELEGATED_SESSION_ID
- BREAKING: Merged
MasterchatAgent
intoMasterchat
- Use
on
andlisten
.iterate
andfetch
are still available for advanced users
- Use
- BREAKING:
new Masterchat(..., {isLive?: boolean})
->new Masterchat(..., {mode?: "live" | "replay"})
- Added type definition for
once
- New
metadata
property - BREAKING: Renamed
MasterchatManager
->StreamPool
- BREAKING: In
StreamPool
event callback,(metadata: Metadata, ...) => {}
->(..., mc: Masterchat) => {}
- i.e.
on("actions", ({ videoId }, actions) => {})
->on("actions", (actions, { videoId }) => {})
- e.g.
on("data", (data, mc) => { if (...) { mc.stop() } })
- i.e.
before:
const mc = new Masterchat(videoId, ...)
try {
for await (const { actions } of mc.iterate()) {
const chats = actions.filter(action => action.type === "addChatItemAction")
...
if (youWant) break;
}
} catch(err) {
...
}
now:
const mc = new Masterchat(videoId, ...)
.on("chats", chats => {
...
if (youWant) mc.stop();
})
.on("error", err => {
...
})
mc.listen()
- BREAKING:
emojiHandler
inrunsToString
now takesYTEmojiRun
instead ofYTEmoji
- Added
textHandler
option torunsToString
- BREAKING:
runsToString
will expand truncated urls (by @stu43005)
- Masterchat Agent for handling events using EventEmitter
- Masterchat Manager for processing multiple live streams
- Required Node.js version is now v16.6.0 or higher
- Re-export more yt types
- Renamed
normalizedVideoId
->toVideoId
toVideoId
will returnsundefined
when the given string doesn't contains any valid id pattern
- Fix format issue in default emoji handler of
runsToString
- Support legacy pageId session (append
SESSION_ID
toCredentials
)
.remove
will use homebrew pb params
.fetch
will attempt to switch an API endpoint to the replay chat if failed to fetch chats from the live chat. Explicitly setisLive
optiontrue
orfalse
when instantiating Masterchat to disable this behavior.- if unset,
- live -> OK
- archive -> first request fails, then try fetching replay chat -> OK
- if set
true
:- live -> OK
- archive -> throw DisabledChatError
- if set
false
:- live -> throw DisabledChatError
- archive -> OK
- if unset,
- Supported
.fetch
overloading.fetch(options?: FetchChatOptions)
.fetch(token: string, options?: FetchChatOptions)
- Renamed
SucceededChatResponse
->ChatResponse
- Dropped
ignoreReplayTimeout
option from.iterate
- credential-fetcher now supports parsing legacy session id
- Full Protocol Buffer support
- Use
new Masterchat(videoId, channelId, {isLive})
for skipping metadata fetching.Masterchat.init(videoId)
scrapes watch page in order to obtain channelId and livechat status - Renamed
masterchat/types/...
->masterchat/yt/...
- Renamed
Masterchat.metadata.isLive
->Masterchat.isLive
- Renamed
Masterchat.metadata.channelId
->Masterchat.channelId
- Renamed
Masterchat.metadata.channelName
->Masterchat.channelName
- Renamed
Masterchat.metadata.title
->Masterchat.title
- Removed
Masterchat.isReplay
fetchMetadata()
->Masterchat.populateMetadata()
iterateChat("top" | "all")
->iterate({topChat: true|false})
,fetchChat({continuation})
->fetch(b64Token)
ORfetch({topChat})
AddSuperChatItemAction.currency
always contains normalized three-letter currency code
- Added diagnosis toolkit
- Renamed
convertRunsToString
->runsToString