HugoJF / twitch-tools

[WIP] Javascript library to work with Twitch content (clips, videos, chat)
10 stars 3 forks source link
twitch twitch-api

Twitch Tools

Cool library to work with Twitch stuff

test test test test

There is ALOT of work currently being done in the library. I try to follow Semver but don't expect anything for it, there are alot of APIs that are far from what I want and I sometimes get carried away changing stuff.

Expect alot of undocumented things, so feel free to explore the source code to find stuff you might need. I'm just documenting parts that I actually use in other projects (for now).

Clips downloader

Fetches clips from a specific channel and downloads them in parallel to increase throughput.

Example

const clipsDownloader = new ClipsDownloader(channel, userId, [options])

await clipsDownloader.start();
Constructor
Methods
Events

Video downloader

Fetches .m3u8 playlist for specific video and downloads each fragment in parallel to increase network throughput. You can also download the entire chat of a VOD.

Example

const videoDownloader = new VideoDownloader(videoOrUrl, options);

await videoDownloader.download();
await videoDownloader.downloadChat();
Constructor
Methods
Events

FAQ

How to fetch userId

The main reason a few APIs still require userId is to avoid calling Twitch's API multiple times without the need for it. Since each part of this repository can be used separately, I just decided to avoid implementing some kind of caching just for this.