xenova/chat-downloader

[QUESTION] How do I get chat log from start of live youtube broadcast?

Closed this issue · 3 comments

What is your question?

I am trying to get the full log of a YouTube broadcast from the very start of the broadcast however I'm only getting the log a minute before the request. The below is the gist of what I have

url =  <SAMPLE LIVE URL>
for chat in ChatDownloader().get_chat(url, start_time=0):
    print(pd.Timestamp(chat['timestamp']*1000))
    chat_log_list.append(chat)

The earliest chat log starts around a minute before the execution of this code.

I tried experimenting with different start_time values (None, -1000, "00:00:00") but nothing seems to give me earlier logs.

I have tested this with non-live videos and it seems to work fine.

for reference I'm using this video https://www.youtube.com/watch?v=JMj9QMQboYg&ab_channel=Destiny but it would probably stop being live so it might not be much help.

Semirelated question but is there an easy way to get the timestamp of when the video starts? I can get the publishing date from YouTube API but would be nice if I could utilize chat-downloader instead.

xenova commented

Hi there. Unfortunately it's not possible to get the chat replay of a video that is still live. You need to wait until the end of the stream to be able to view the past chat history.

I see, that's unfortunate. Thank you for the reply.