Skip to content
This repository has been archived by the owner on Aug 15, 2021. It is now read-only.

Support Clips #69

Open
freaktechnik opened this issue Dec 22, 2017 · 12 comments
Open

Support Clips #69

freaktechnik opened this issue Dec 22, 2017 · 12 comments

Comments

@freaktechnik
Copy link
Owner

Support fetching the chatlog from clips. This probably involves getting the VOD ID for the clip and the start offset. Or maybe there's a dedicated chat replay API.

@freaktechnik
Copy link
Owner Author

That's exactly how twitch does it. https://clips.twitch.tv/api/v2/clips/DepressedAdventurousPeanutKAPOW contains the VOD ID and content_offset_seconds value.

@freaktechnik
Copy link
Owner Author

freaktechnik commented Dec 22, 2017

I guess that information would also be in https://dev.twitch.tv/docs/v5/reference/clips#get-clip (offset is available as vod.offset)

@freaktechnik
Copy link
Owner Author

Sadly helix will not carry the offset.

@OgulcanCelik
Copy link

Any progress on the edition of clips support? I found this npm package and I need to extract chat data of a clip and this is the best I could find.

@freaktechnik
Copy link
Owner Author

I haven't worked on this at all. What needs to be done is primarily actually detecting when a clip should be loaded (or add a special param for it) and then getting the offset, length and source VOD id from the API above and then run the normal logic with that.

@OgulcanCelik
Copy link

Hmm, I tried exactly that, however, the length command does not work it seems. Maybe API is changed? Because whatever parameter I give as length, the outcome is always the same length chat log. If I can set the length of log with the starting time, I can get all information I want since clip api returns the vod id, clip offset as second and the length.

@freaktechnik
Copy link
Owner Author

The length option is working as expected for me. It will always return all message chunks that are in the given time range, which may return a few extra messages. There also may not be messages at all.

Specific parameters where it's not working for you would be very helpful.

@OgulcanCelik
Copy link

Thanks for replies, I really appreciate it! The clip which I'm trying to get it's text data is this: https://clips.twitch.tv/BenevolentPunchyLyrebirdMingLee. So I know the vod id of it is: 302339233, and the vodoffset is: 37565. Clip length is also 1 minute. So I'm trying with these parameters but only got few chat logs:
twitch-chatlog 302339233 --start 10:26:04 -l 600 -C kimne78kx3ncx6brgo4mv6wki5h1ko

@freaktechnik
Copy link
Owner Author

Thank you for that. I've found a bug in the logic that decides if it should load another fragment. This should be fixed in 6.0.1

@OgulcanCelik
Copy link

It's fixed thank you very much.
Uhm could be stupid but I have one more question. Do I need to use this packet only on console? I mean, is it possible to invoke the twitch-chatlog command like in an another js. file which could do some work with the output?

@freaktechnik
Copy link
Owner Author

You can invoke it like any other module. you can load the main module that does the whole loading with require("twitch-chatlog/lib"). All exported functions have docblocks, so you should be able to figure out how to use them - though the documentation may happen to be out of date in places. In general, the binary shows the usage of the exported functions, too.

@OgulcanCelik
Copy link

Okay. Thank you very much again for this awesome module.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants