This program converts live chat from YouTube downloaded using the yt-dlp application.
To download live chat from YouTube using the yt-dlp application, call it with the parameters --write-sub --sub-lang live_chat. The live chat will be saved in JSONL (JSON Lines) format to a file with the .json extension.
Sample execution of the yt-dlp.exe application downloading a YouTube recording with the best available video and audio quality and live chat:
yt-dlp.exe -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+ba/b" --extractor-args "youtube:player-client=default,-tv_simply" --write-sub --sub-lang live_chat https://link_to_the_youtube_video/
In this repository, I've included sample PowerShell code (yt-down.ps1) that downloads a YouTube recording along with a live chat saved in JSON (.json) format and converts it to a text file (.txt).
Usage: chat-converter.exe [--json JSON] [--output OUTPUT] [--print] [--add-line-number] [--help | -h]`
Options:
--json JSON- Input JSON Chat file orautoto select first JSON file in current directory--output OUTPUT- Output text Chat file orautoto create output file with same name as input file and add .txt extension--print- Print Chat messages to console--add-line-number- Add line numbers to each message in output file and console output--help,-h- Show this help message and exit