From 6f0483f51b00b567aec1313a9a39de0f47bddcef Mon Sep 17 00:00:00 2001 From: Ramforth Date: Thu, 30 Oct 2025 18:18:39 +0100 Subject: [PATCH] Implement 5-second display for video ID in pytchat_listener.py --- pytchat_listener.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pytchat_listener.py b/pytchat_listener.py index 5ff8557..15288f6 100644 --- a/pytchat_listener.py +++ b/pytchat_listener.py @@ -1,6 +1,7 @@ import pytchat import sys import os +import time from rich.console import Console from rich.style import Style @@ -15,6 +16,14 @@ def main(): try: livechat = pytchat.create(video_id=video_id) console.print(f"[green]Listening to live chat for video ID: {video_id}[/green]") + # pytchat doesn't directly expose the live_chat_id in the same way as the official API + # For now, we'll just display the video_id as confirmation. + # If a live_chat_id is needed, further pytchat internal analysis would be required. + console.print(f"[green]Video ID accepted: {video_id}[/green]") + + # Wait for 5 seconds, then clear the screen + time.sleep(5) + os.system('clear') message_count = 0 while livechat.is_alive(): @@ -38,4 +47,4 @@ def main(): console.print("[yellow]Live chat listener stopped.[/yellow]") if __name__ == '__main__': - main() + main() \ No newline at end of file