Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Latest commit

 

History

History
37 lines (28 loc) · 1.39 KB

README.md

File metadata and controls

37 lines (28 loc) · 1.39 KB

CaffeineTVJavaApi

A (very) unofficial way of getting Caffeine related data including stream chat.

UPDATE This project is long dead, swing is buggy and even then it doesn't work well with OBS. As an alternative you can use either Casterlabs (Runs more like classic streamlabs or maelstream) or Caffeinated (Runs locally). Thanks for your interest and I hope this repo atleast gives you some development knowledge on Caffeine.

Usage

You can find the project on JitPack.

CaffeineProfile profile = new CaffeineProfile(username);
profile.isValid(); // returns false if a user doesn't exist.

EventListener listener = (new ChatListener() {
  @Override
  public void onEvent(Chat chat) {
    // Code here
  }
})
CaffeineStream stream = new CaffeineStream(profile, listener); // Automatically connects, if not an error is thrown.
stream.close(); // Close.
stream.isOpen(); // Is open, directly from the websocket api.

What it accesses

https://api.caffeine.tv/v1/users/$username # Where to get client information
wss://realtime.caffeine.tv/v2/reaper/stages/$stage-id/messages # Socket address for stream events
{"Headers":{"Authorization":"Anonymous API","X-Client-Type":"api"}} # Headers for websocket
https://images.caffeine.tv/$avatar-link # Where you can get an avatar, every client has an associated avatar_link