@@ -25,6 +25,7 @@ import {
2525 VideoObject ,
2626 YTCommentThreadRenderer ,
2727 YTContinuationItem ,
28+ YTReloadContinuation ,
2829} from "./interfaces" ;
2930import {
3031 Action ,
@@ -149,6 +150,8 @@ export class Masterchat extends EventEmitter {
149150 public title ?: string ;
150151 public videoMetadata ?: VideoObject ;
151152
153+ private continuations ?: YTReloadContinuation [ ] ;
154+
152155 private axiosInstance : AxiosInstance ;
153156 private listener : ChatListener | null = null ;
154157 private listenerAbortion : AbortController = new AbortController ( ) ;
@@ -443,6 +446,7 @@ export class Masterchat extends EventEmitter {
443446 this . isUpcoming = metadata . isUpcoming ;
444447 this . isMembersOnly = metadata . isMembersOnly ;
445448 this . videoMetadata = metadata . metadata ;
449+ this . continuations = metadata . continuations ;
446450 }
447451
448452 public async fetchMetadataFromWatch ( id : string ) {
@@ -677,16 +681,27 @@ export class Masterchat extends EventEmitter {
677681 let requestUrl : string = "" ;
678682 let requestBody ;
679683 let payload : YTChatResponse ;
684+ let self = this ;
680685
681686 function applyNewLiveStatus ( isLive : boolean ) {
682687 requestUrl = isLive ? Constants . EP_GLC : Constants . EP_GLCR ;
683688
684- const continuation =
685- typeof tokenOrOptions === "string"
686- ? tokenOrOptions
687- : isLive
688- ? liveReloadContinuation ( target , { top : topChat } )
689- : replayTimedContinuation ( target , { top : topChat } ) ;
689+ let continuation : string ;
690+ if ( typeof tokenOrOptions === "string" ) {
691+ continuation = tokenOrOptions ;
692+ } else if ( isLive ) {
693+ continuation = liveReloadContinuation ( target , { top : topChat } ) ;
694+ } else if ( self . isMembersOnly ) {
695+ // TODO: 2025-12-28: Temp fix for MembersOnly as I have no idea how to update `replayTimedContinuation` for new continuation as YT changed something
696+ continuation = self . continuations ?. [ 0 ] ?. reloadContinuationData
697+ ?. continuation as string ;
698+ } else {
699+ continuation = replayTimedContinuation ( target , { top : topChat } ) ;
700+ }
701+
702+ if ( ! continuation ) {
703+ throw new DisabledChatError ( "continuation not found" ) ;
704+ }
690705
691706 requestBody = withContext ( {
692707 continuation,
0 commit comments