Skip to content

Commit

Permalink
Add default ChatPageContext instance to YoutubeChatMonitorEntity to r…
Browse files Browse the repository at this point in the history
…estore broken startup logic
  • Loading branch information
user committed Mar 7, 2024
1 parent c08052d commit 5f509f1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions avtdl/plugins/youtube/youtube_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
from avtdl.core.plugins import Plugins
from avtdl.core.utils import Delay, Fmt, parse_timestamp_us
from avtdl.plugins.youtube import video_info
from avtdl.plugins.youtube.common import NextPageContext, extract_keys, find_all, find_one, get_innertube_context, get_session_index, handle_consent, \
from avtdl.plugins.youtube.common import NextPageContext, extract_keys, find_all, find_one, get_innertube_context, \
get_session_index, handle_consent, \
parse_navigation_endpoint, prepare_next_page_request


Expand Down Expand Up @@ -97,7 +98,11 @@ def discord_embed(self) -> List[dict]:
}
return [embed]


class ChatPageContext(NextPageContext):
innertube_context: Optional[dict] = None
session_index: str = ''
continuation_token: Optional[str] = None
is_replay: Optional[bool] = None
continuation_url: Optional[str] = None
base_update_interval: float = 120
Expand All @@ -108,7 +113,7 @@ class YoutubeChatMonitorEntity(BaseFeedMonitorEntity):
url: str
update_interval: float = 20
adjust_update_interval: bool = Field(exclude=True, default=False)
context: ChatPageContext = Field(exclude=True, default=None)
context: ChatPageContext = Field(exclude=True, default=ChatPageContext())


@Plugins.register('prechat', Plugins.kind.ACTOR_CONFIG)
Expand Down

0 comments on commit 5f509f1

Please sign in to comment.