Chat replay is here! This does all the things we've discussed in the meetings, plus other stuff I thought it'd be useful to support.
The editor page shows a static transcript of all the chat that occurs during the loaded video.
The restreamer page streams the chat as if chat is chatting during your view.
In both cases, purged messages and users are shown lowlighted and crossed out. In the restreamer, the lowlight/crossout is applied at the time the CLEARCHAT/CLEARMSG is processed, which aligns with when it was sent in actual Twitch chat. (It was easier to implement this way).
Emotes are supported.
I added support for replies as well. If the message being replied to is in the chat replay on your page, you can click the reply to jump to the relevant message. (This was relatively easy to implement as a consequence of how I chose to implement CLEARMSG.)
I didn't end up referencing Didero's code basically at all--I looked at the start of it, saw how YouTube-specific the first lines of it were, and thought it'd probably be easier to just make my own thing than to convert that script's chat downloader to parse our JSON instead.
Note that chat is not supported for streaming (which is to say, you must have a start and end time specified to see chat--chat will not be loaded for unbounded streams). This would complicate my code a bit but also is not supported by the restreamer server. I think we can consider that for a standalone enhancement in the future. (I could consider an enhancement where we do the pagination ourselves in Thrimbletrimmer, but it's worth noting that the restreamer chat archive gets saved about once per minute, which makes accurately retrieving the chat JSON somewhat more difficult.)
This also pulls emotes directly from Twitch. When we do our emote archiving, we may wish to choose to swap emote fetching to be from Wubloader instead. I would propose that this be a wholly separate project/PR from this one.
Chat replay is here! This does all the things we've discussed in the meetings, plus other stuff I thought it'd be useful to support.
I didn't end up referencing Didero's code basically at all--I looked at the start of it, saw how YouTube-specific the first lines of it were, and thought it'd probably be easier to just make my own thing than to convert that script's chat downloader to parse our JSON instead.
Note that chat is not supported for streaming (which is to say, you must have a start and end time specified to see chat--chat will not be loaded for unbounded streams). This would complicate my code a bit but also is not supported by the restreamer server. I think we can consider that for a standalone enhancement in the future. (I could consider an enhancement where we do the pagination ourselves in Thrimbletrimmer, but it's worth noting that the restreamer chat archive gets saved about once per minute, which makes accurately retrieving the chat JSON somewhat more difficult.)
This also pulls emotes directly from Twitch. When we do our emote archiving, we may wish to choose to swap emote fetching to be from Wubloader instead. I would propose that this be a wholly separate project/PR from this one.