lay295 / TwitchDownloader

Twitch VOD/Clip Downloader - Chat Download/Render/Replay
MIT License
2.7k stars 260 forks source link

[Question] Would it be possible to parse plain text as JSON file? #629

Open sunkhaskasis opened 1 year ago

sunkhaskasis commented 1 year ago

Checklist

Write stuff here

Suppose I have chat stored in plain .txt, like this (warning: a lot of text): https://logs.ivr.fi/channel/forsen/2018/05/08

Would it somehow be possible to parse as a JSON chat log that can be rendered by the Downloader? I've had this question stuck in my head for a couple of years now because I wanted to somehow be able to render chat for old Forsen VODs, but I've no idea where to begin with this.

lay295 commented 1 year ago

It's possible, just a lot of imperfections. I did make a program a few years ago that would convert overrustle logs or logs.ivr.fi logs into JSONs compatible with this program. It would probably be cool and worth it to put in the main program, dunno though :)

A few issues are

  1. No badges
  2. No way to really tell a first party emote from another streamer (an example in this is nymnOkay)
  3. No way to know old 3rd party emotes

image

ScrubN commented 1 year ago

For a while, I've been thinking of making a tool to help modify/generate bogus test chats en masse. Perhaps it would be best to integrate plaintext/overrustle/chatterino log parsing in that due to the large amount of unknowns, and we can just link to that in the README somewhere.

sunkhaskasis commented 1 year ago

One way the sub and global emotes can be retrieved is if we somehow save them to a separate json file. This repository is a good example: https://github.com/ahabyss/TCRParser

Unfortunately, there are several flaws with this method. For one, I don't think it's possible to fetch every SINGLE sub emote. TCRParser used twitchemotes' now-dead API. Secondly, it'd bloat our repo, even more than the Noto Emoji zip did.

As for the 3rd party emotes, they may have to be downloaded manually. Some streamers have bots which can tell what exact emotes are enabled on the channel.

чт, 23 мар. 2023 г., 4:09 Scrub @.***>:

I've been thinking of making a tool to help modify/generate bogus test chats for a while now. Perhaps it would be best to integrate plaintext/overrustle/chatterino log parsing in that due to the amount of unknowns, and we can just link to that in the README somewhere.

— Reply to this email directly, view it on GitHub https://github.com/lay295/TwitchDownloader/issues/629#issuecomment-1480445625, or unsubscribe https://github.com/notifications/unsubscribe-auth/AESODS3O4M4V3MCFBYKAWGLW5OPFHANCNFSM6AAAAAAWEBKL3M . You are receiving this because you authored the thread.Message ID: @.***>

fostotifyu commented 1 year ago

I just wanted to bump this topic. I'm by no means an expert on this, but I have wanted to take the chat logs we can get from logs.ivr.fi and somehow use them with TwitchDownloader for a while as well. If parsing a plain .txt file is not possible, I have found by adding "?json=true" to a given justlogs url, it does produce a .json file for the chat log, but it seems to be formatted differently than what TwitchDownloader allows:

https://logs.ivr.fi/channel/forsen/2018/05/08?json=true

Forgive me for my ignorance if this would take a lot of work to parse and make compatible, but either way, I am interested in somehow making old/deleted chat logs viable in TwitchDownloader, one way or another.

ScrubN commented 1 year ago

For a while, I've been thinking of making a tool to help modify/generate bogus test chats en masse. Perhaps it would be best to integrate plaintext/overrustle/chatterino log parsing in that due to the large amount of unknowns, and we can just link to that in the README somewhere.

I have thrown away all of my existing code in order to switch UI frameworks and have found it to be progressing much smoother than it was before. I hope to have this done within a few weeks (no promises) but expect it to take a while since this is my first time using AvaloniaUI.

I will post the github link here when it is done and possibly in the README somewhere with @lay295's permission. As it stands now the application is a generally prettier visualization for chat jsons with some buttons to add random fake messages/data.

I just wanted to bump this topic. I'm by no means an expert on this, but I have wanted to take the chat logs we can get from logs.ivr.fi and somehow use them with TwitchDownloader for a while as well. If parsing a plain .txt file is not possible, I have found by adding "?json=true" to a given justlogs url, it does produce a .json file for the chat log, but it seems to be formatted differently than what TwitchDownloader allows:

https://logs.ivr.fi/channel/forsen/2018/05/08?json=true

Forgive me for my ignorance if this would take a lot of work to parse and make compatible, but either way, I am interested in somehow making old/deleted chat logs viable in TwitchDownloader, one way or another.

I will do my best to implement logs.ivr.fi chat jsons once the base application is completed.