Made a tool to search through Twitch chats

Help needed:

I’m not a web developer, so trying to figure out afreecatv is going to be a difficult endeavor. If we have any people familiar with javascript and ajax (which is what I’m assuming they’re using to pull requests), please do pm me or respond.

These are some details I’ve found while looking through their JS:

var VIDEOIMG_AFREECATV = ((document.location.protocol == 'https:') ? 'https:' : 'http:') + '//videoimg.afreecatv.com'; // 아카이브 썸네일

{
        key: 'CHAT_LOAD_URL',
        get: function () {
          return this.constructor.chatLoadUrl || VIDEOIMG_AFREECATV + '/php/ChatLoad.php'
        },
        set: function (e) {
          this.constructor.chatLoadUrl = e
        }
      },

Another call involving this data type happens below

value: function (e, t, r) {
          $.ajax({
            type: 'GET',
            url: u.default.CHAT_LOAD_URL,
            data: {
              rowKey: e.fileInfoKey + '_c',
              startTime: r
            },
            context: this,
            dataType: 'text',
            success: function (r) {
              if (r) {
                var n = t.bind(this);
                e.chatXML = r,
                n(e)
              }
            },
            error: function (e, t, r) {
            }
          })
        }

Unfortunately, I’m not sure where they’re getting parameters from (in part because the code is 40000+ lines long)

Edit:
Here’s a link I tested out: https://videoimg.afreecatv.com/php/ChatLoad.php?rowKey=_c&startTime=

The XML definitely looks like a real chat transcript, it’s just hard to discern where it’s coming from

Edit #2:

I’ve found where the rowKey is located in the HTML

1 Like

Update:

  • You can now filter through clips on a channel (For the time being, Helix limits this to the top 1000-1100 clips on a channel sorted by viewcount) (Code has been changed so that clips are grouped then merged on a per-month basis, this is slower and won’t catch all clips, but is better than the previous implementation)
  • Removed the query requesting for count, will now default to 100 (you can stop the program using ctrl+z or the ‘stop’ button)
  • Code cleanup
3 Likes

Man I’ve been thinking of how great it would be if you could search a channels clips and u go out do without me even asking. Good stuff man.

A word of warning to those using the tool: Don’t go spamming repeat and whatnot on the clips, it’s a bad look when a streamer (especially a smaller one) looks at their clips and all the top ones have burp in the title so just be smart about it.

1 Like

Hey there, I’d like to share a bug I’m having (not sure it’s a bug or if I’m doing something wrong).
After I type “c” to request to look through a channel, it doesn’t give me the option to mention the channel, and when I put the word I want to look for, the message above appears D:

Also, I downloaded the executable file for Windows, but when I typed c the program shut down D:

1 Like

I’m not the programmer but maybe just type out ‘channel’ rather than ‘c’? Now that ‘clips’ is an option ‘c’ is ambiguous so maybe he got rid of the abbreviations.

2 Likes

^^This is the correct answer. I should’ve made a note about that

1 Like

I’m sorryyyy, totally didn’t notice that clips was an option now too hehehehe
It’s working now, thanks a bunch <3

How do I watch some of the clips that require downloads, because when I download it says cant play file

Hmm, for clips, the program doesn’t output direct m3u8 links (just webpage links) however for vods they do- I think you might be referring to vods. You will need to use a media player like MPV or VLC that has streaming abilities to play the m3u8 files

1 Like

Would you like to see a GUI interface in a future update?

  • Yes
  • No

0 voters

(No guarantees, just wanted to ask)

Notice: I’ve now switched the apis used for retrieving data with chat_reader. All older version before 1.14 will no longer function. If you are using 1.13, please update to continue using Twitch search functionality

1 Like

Could you explain exactly how to do this

I downloaded it and its working fine but after I go through all the chats it immediately shuts down for some reason.

1 Like

If you’re on windows, you may be double clicking on the executable. By nature, once the program ends, the process closes (which also closes the terminal window). You can remediate this by opening command prompt/or any other terminal, then dragging and dropping the chat_reader executable into the terminal window (you should see a path get filled in), then pressing enter.

To rerun the program, you can press the up arrow key and then press enter again (rather then dragging and dropping over and over)

Here’s a video, in case I did a bad job explaining: https://www.youtube.com/watch?v=_NFQr7IJ1DE

3 Likes

When I try to search through the whole channel, after I put in the name when it tell me to put in keywords a whole bunch of other stuff comes up and I can’t put in nothing.

Is this with 1.14?

it’s through this link https://replit.com/@TheCrackTBFF/ChatReader
i actually just had the same issue

1 Like

Yeah, repl.it will no longer work since the client ID no longer work. You could try forking it and providing your own client id and secret and it should work again, but I haven’t touched the java version since I switched to Rust. I’d suggest using the Rust version linked in the main post

ahh gotcha. are there any versions that work on MacBook?

1 Like

If you’ve got a MacBook, you can actually build the latest version yourself (see the readme). If you wouldn’t like to venture that route, I might also ask my friend if I can borrow his mac for a couple minutes and I could have a version available for MacOS soon. The MacOS release is now available on GitHub

1 Like