xenova / chat-downloader

A simple tool used to retrieve chat messages from livestreams, videos, clips and past broadcasts. No authentication needed!
https://chat-downloader.readthedocs.io/
MIT License
902 stars 127 forks source link

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

Closed kkawabat closed 11 months ago

kkawabat commented 12 months ago

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.

kkawabat commented 12 months ago

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 12 months ago

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.

kkawabat commented 11 months ago

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