lay295 / TwitchDownloader

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

Highlights / Channel Points / Subscription Rendering #102

Closed goldbattle closed 3 years ago

goldbattle commented 3 years ago

Thanks again for the great utility. I was talking a look through to try to see if it was possible to add a chat render option flag to show highlighted messages, channel point spending, and subscription messages. The thought is to have a small message with a highlighted bar on the left side and slightly greyed out text.

image

Looking at the API I see that this can be detected by by looking at the user_notice_params/msg-id string. Also if the user sent a message along with the default subscription notice it seems it will be the second fragment object. Just wanted to open an issue, to see if you had any thoughts on this. I see right now all non-highlighted messages are skipped. I have not figured out if channel point sending is reported by the API, but I have not seen that yet from my inspection.

{
  "_id": "d955ef2d-ebfe-4261-bd03-bb9b1b0f74fd",
  ....
  "commenter": {
    ....
  },
  "source": "chat",
  "state": "published",
  "message": {
    "body": "tex3568 subscribed with Prime. They've subscribed for 2 months, currently on a 1 month streak! sodaNice",
    "fragments": [
      {
        "text": "tex3568 subscribed with Prime. They've subscribed for 2 months, currently on a 1 month streak! "
      },
      {
        "text": "sodaNice"
      }
    ],
    ....
    "user_color": "#417EF3",
    "user_notice_params": {
      "msg-id": "resub", // can be sub, resub, subgift
      ....
    }
  }
},
lay295 commented 3 years ago

Yeah looking into it I don't think the chat data contains stuff related to redeeming channel points except for the highlighted messages. I didn't wanna highlight the messages with the purple like how Twitch does it, because it's really ugly imo. I could add the purple bar to left, and a greyed out message for subs or highlighted text.

One of the problems is that I don't really leave any room on the left currently, so I would have to figure out how to deal with that.

image

Should I shift all messages to the right and leave padding on the left so when I need to add the purple bar it looks fine, and the icons are still aligned like in the Twitch screenshot? Or should I only shift the message of the sub message to the right.

image

I could do 1st which looks best, but might throw people off who have been using it that suddenly there is space to the left, or I could go with option 2 which looks a bit weird but keeps the same padding on the left.

goldbattle commented 3 years ago

Hmm, yeah I feel that the option 1 (left) looks a lot better. Maybe a middle ground between the two? not sure if there is that much a need for the space between the purple and the message. Could just add maybe 4-5px (the width of the purple line) as padding and be pretty close to the existing layout? I feel like the entire message could be grayed out (as compared to having a white name) to make it look a bit better also.

lay295 commented 3 years ago

A basic version has been added in 1.39.

image

It doesn't look as good as live but looks comparable to the Twitch VOD chat. In the future I might add more styling to it or add the user badges/username to the left of his message. But with how the renderer is setup right now it's a little hard to do that.

image

Stargateur commented 1 year ago

unless I made a mistake option --sub-messages is supposed control that no ? I still get "x subscribed with" even if I set this option to false. I would like a way to control both the "automatic" message and the subscriber message (two option to enable the automatic and enable the subscriber message separately). Also, there is no way to control the language.