Livestream lifecycle detection
Go to file
cj@futureporn.net ebec893656 add api server, handle multiple rooms 2023-12-06 15:04:22 -08:00
assets init 2023-06-27 16:58:10 -08:00
src add api server, handle multiple rooms 2023-12-06 15:04:22 -08:00
test add api server, handle multiple rooms 2023-12-06 15:04:22 -08:00
.gitignore progress 2023-12-04 09:44:15 -08:00
.mocharc.json progress 2023-12-04 09:44:15 -08:00
ISSUE1.md progress 2023-07-14 06:16:58 -08:00
README.md progress 2023-12-04 09:44:15 -08:00
audio-test.js remove scraps 2023-07-22 00:21:07 -08:00
ecosystem.config.cjs fix ts build weirdness 2023-07-18 21:34:18 -08:00
export.js init 2023-06-27 16:58:10 -08:00
index.ts add api server, handle multiple rooms 2023-12-06 15:04:22 -08:00
package.json add api server, handle multiple rooms 2023-12-06 15:04:22 -08:00
pnpm-lock.yaml add api server, handle multiple rooms 2023-12-06 15:04:22 -08:00
taco.html progress 2023-07-14 06:16:58 -08:00
testdex.js progress 2023-07-14 06:16:58 -08:00
tsconfig.json fix #3 2023-09-06 15:12:01 -08:00

README.md

scout

Installation

Dependencies

ffplay

Usage

Daemon mode. Log chat and room events

node ./dist/index.js daemon

Dossier mode. Get a room's initialRoomDossier. Helpful for getting a room's Chaturbate ID.

node ./dist/index.js dossier -r projektmelody

Dev notes

Future idea: Export mode. Export sql chat messages as IndexedDB

test

TUI

A live table which shows ongoing active subscriptions

Room Message Silence Status Title Tip Password
pro. x
el_. x
sky. x

We're going to need to refactor the code a bit.

First we need an eventloop of sorts. A thing to ensure that we are always subscribing to the correct rooms and the correct Ably channels.

I think it needs to go like this.

  1. Startup
  2. Get list of rooms we are watching
  3. For each room,
    • subscribe to status channel
    • if we are unable to subcribe,
      • subscribe to password channel (? does this work in pw mode ?)
  4. When status channel tells us a room goes live,
    • subscribe to message, silence, title, tip, and pw channels.
  5. When status channel tells us a room goes offline,
    • wait 5 mins
    • stop this process if room is online again
    • unsubscribe from everything except status ch.

Ably realtime event formats

room:notice:

{
  "name": "room:notice:6DDY7ZC",
  "id": "u-Y6UQ8JV3:0:0",
  "encoding": null,
  "data": {
    "tid": "16755044232:9830",
    "ts": 1675504423.225136,
    "messages": [
      " %%%[emoticon stwad2|https://static-pub.highwebmedia.com/uploads/avatar/2022/11/26/01/46/adec68059ed40d9dbb78260c9a46871c8c2070c4.jpg|76|78|/emoticon_report_abuse/stwad2/]%%% skinny_sis's Spin the Wheel ",
      " Tip 33 tokens and you can win one of the 12 prizes ",
      " Chance of winning: 67%. Type /wheel for the prizes "
    ],
    "to_user": "",
    "notice_type": "app",
    "foreground": "rgb(103,77,255)",
    "background": null,
    "weight": "bolder",
    "method": "lazy",
    "pub_ts": 1675504423.230338
  }
}

room:title_change:

{
  "name": "room:title_change:6DDY7ZC",
  "id": "vAj6M1bn9D:0:0",
  "encoding": null,
  "data": {
    "tid": "16755100793:8346",
    "ts": 1675510079.3160765,
    "title": "❤CUM SHOW❤ Pvt is open 30per/min [1386 tokens left] #bigboobs #teen #18 #new #asian",
    "pub_ts": 1675510079.3162484,
    "method": "single"
  }
}

room:update:

{
  "name": "room:update:6DDY7ZC",
  "id": "meLVS3wTan:0:0",
  "encoding": null,
  "data": {
    "tid": "16755100794:436",
    "ts": 1675510079.4469855,
    "target": "refresh_panel",
    "target_user": "",
    "pub_ts": 1675510079.4471552,
    "method": "single"
  }
}

room:status::0

{
  "name": "room:status:ZF09ZAC:1",
  "id": "cCs6ThzT-p:0:0",
  "encoding": null,
  "data": {
    "tid": "16755114015:96114",
    "ts": 1675511401.588585,
    "status": "away",
    "message": "",
    "hash": "",
    "method": "lazy",
    "pub_ts": 1675511401.5939016
  }
}

{
  "name": "room:status:ZF09ZAC:1",
  "id": "Zk1EF44xrP:0:0",
  "encoding": null,
  "data": {
    "tid": "16755114435:80861",
    "ts": 1675511443.533211,
    "status": "public",
    "message": "",
    "hash": "",
    "pub_ts": 1675511443.5339801,
    "method": "single"
  }
}

room:update:

{
  "name": "room:update:ZF09ZAC",
  "id": "vOqwMouvAB:0:0",
  "encoding": null,
  "data": {
    "tid": "16755118892:73991",
    "ts": 1675511889.2104225,
    "target": "refresh_panel",
    "target_user": "",
    "pub_ts": 1675511889.2105591,
    "method": "single"
  }
}

room:status::0

{
  "name": "room:status:ZF09ZAC:1",
  "id": "gs04uEHZTV:0:0",
  "encoding": null,
  "data": {
    "tid": "16755147455:43279",
    "ts": 1675514745.5818536,
    "status": "offline",
    "message": "",
    "hash": "",
    "pub_ts": 1675514745.5831933,
    "method": "single"
  }
}

debug: handling room error. Bad Request {"service":"futureporn/scout","timestamp":"2023-11-20T19:44:44.535Z"}
debug: handling room error. Bad Request {"service":"futureporn/scout","timestamp":"2023-11-20T19:44:44.536Z"}
debug: Ably authCallback. Getting a fresh new Ably TokenRequest. {"service":"futureporn/scout","timestamp":"2023-11-20T19:44:44.537Z"}
debug: getting pushServiceAuth. {"service":"futureporn/scout","timestamp":"2023-11-20T19:44:44.537Z"}
debug: using cookie string csrftoken=gQUnyHUTg7lZBTNn374s96a7DYAVxqZ5xrPi2RzWfrzJT61EfrLHvr6wFRMwhcUz; sbr=sec:sbref421fda-4ec5-4a7f-93ea-9a74a8c85484:1qdk9F:movx7uli5YEZ4UNB_GPURHopOLI {"service":"futureporn/scout","timestamp":"2023-11-20T19:44:44.537Z"}
debug: {"token":null,"channels":{"RoomMessageTopic#RoomMessageTopic:G0TWFS5":"room:grouped:G0TWFS5:16","RoomStatusTopic#RoomStatusTopic:G0TWFS5":"room:grouped:G0TWFS5:16","RoomTipAlertTopic#RoomTipAlertTopic:G0TWFS5":"room:grouped:G0TWFS5:16","RoomPasswordProtectedTopic#RoomPasswordProtectedTopic:G0TWFS5":"room:grouped:G0TWFS5:16"},"failures":{"RoomMessageTopic#RoomMessageTopic:G0TWFS5":"Bad Request","RoomStatusTopic#RoomStatusTopic:G0TWFS5":"Bad Request","RoomTipAlertTopic#RoomTipAlertTopic:G0TWFS5":"Bad Request","RoomPasswordProtectedTopic#RoomPasswordProtectedTopic:G0TWFS5":"Bad Request"},"token_request":{},"client_id":"-anonef421fda-4ec5-4a7f-93ea-9a74a8c85484","settings":{"backend":"a","flags":{"pm_enabled":true,"wowza_disabled":true,"userlist_enabled":true,"verify_enabled":false,"fallback_eligible":true,"is_live":true},"rest_host":"realtime.pa.highwebmedia.com","realtime_host":"realtime.pa.highwebmedia.com","fallback_hosts":["a-fallback.pa.highwebmedia.com","b-fallback.pa.highwebmedia.com","c-fallback.pa.highwebmedia.com","d-fallback.pa.highwebmedia.com","e-fallback.pa.highwebmedia.com"]}} {"service":"futureporn/scout","timestamp":"2023-11-20T19:44:46.747Z"}
restHost:realtime.pa.highwebmedia.com >> realtimeHost:realtime.pa.highwebmedia.com >> fallbackHosts:a-fallback.pa.highwebmedia.com,b-fallback.pa.highwebmedia.com,c-fallback.pa.highwebmedia.com,d-fallback.pa.highwebmedia.com,e-fallback.pa.highwebmedia.com
debug: Got a new TokenRequest {"service":"futureporn/scout","timestamp":"2023-11-20T19:44:46.748Z"}
debug: {} {"service":"futureporn/scout","timestamp":"2023-11-20T19:44:46.748Z"}
11:44:46.748 Ably: Auth.requestToken(): Expected token request callback to call back with a token string, token request object, or token details object