ILikeTurtles
ILikeTurtles

Reputation: 1022

How to archive chat from youtube video live stream without API?

I have a video that I want to download from YouTube but I also want the chat of the entire live stream.

youtube-dl \
--limit-rate '0.25M' \
--retries '3' \
--no-overwrites \
--call-home \
--write-info-json \
--write-description \
--write-thumbnail \
--all-subs \
--convert-subs 'srt' \
--write-annotations \
--add-metadata \
--embed-subs \
--download-archive '/archive/videos/gamer_Archive/gamer_Archive.ytdlarchive' \
--format 'bestvideo+bestaudio/best' \
--merge-output-format 'mkv' \
--output '/archive/videos/gamer_Archive/%(upload_date)s_%(id)s/gamer_Archive_%(upload_date)s_%(id)s_%(title)s.%(ext)s' \
'https://www.youtube.com/watch?v=HPmhA3FpQNA' ;

I obviously am not the owner of the video and I cannot seem to use the API to pull the chat. How do I pull the video and all of the chat logs for the video? Can I do this using YouTube-DL? I tried meta-data, embed-subs, and everything else I could find online in the hopes the chat is written somewhere but I cannot find it.

Upvotes: 3

Views: 2826

Answers (1)

dmitry_romanov
dmitry_romanov

Reputation: 5425

I did it using this library: https://pypi.org/project/chat-replay-downloader/

Commands to do it (Linux, bash, python):

$ python -m venv venv
$ source venv/bin/activate
$ pip install chat-replay-downloader
$ chat_replay_downloader https://www.youtube.com/watch?v=yOP-VT0Q9mk >> chat.txt

Upvotes: 1

Related Questions