jaw-sh / stream-nexus

Unified multicast stream chat overlay.
25 stars 8 forks source link

Add X/Twitter chat support #14

Closed y-a-t-s closed 8 months ago

y-a-t-s commented 9 months ago

Got chat working for the artist formerly known as Twitter. I don't know what identifiers broadcasters or subscribers have, if any. I'm not sure if there are premium chats either.

Their selectors are pure garbage, so I had to rely highly on the hierarchy.

jaw-sh commented 9 months ago

Are there no websockets?

y-a-t-s commented 9 months ago

I haven't checked. I should start taking a look at that for all of the services, where possible.

y-a-t-s commented 9 months ago

It appears to go through numerous post requests to /chatapi/v1/history

Edit: This may just be for replayed streams. However, I would imagine they don't use WebSockets for live stuff either if they don't do it here.

Edit 2: I found wss://prod-chatman-ancillary-us-east-1.pscp.tv/chatapi/v1/chatnow while poking around in Spaces. It gives a feed that is identical to the history calls I was seeing earlier so parsing code could be reused easily.

y-a-t-s commented 8 months ago

You can search for broadcasts using the url operator which searches expanded URLs. Just figured this out.

i.e. url:broadcasts to match the /i/broadcasts part of the stream URL.

jaw-sh commented 8 months ago

I'm in the middle (about 75% done) of a huge update to switch off dom observation.

that's an incredible tip btw

y-a-t-s commented 8 months ago

Yeah I'm glad I was able to figure something out. It was driving me crazy. There's a lot of handy info here