Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Vasiliy Tolstov 2022-08-12 01:20:31 +03:00
parent 2ef3e1fc8d
commit 4cb32b2344
2 changed files with 7 additions and 23 deletions

View file

@ -58,9 +58,9 @@ type ServerResponse struct {
} `json:"params,omitempty"`
}
func startRoom(room, server, proxy string, u *url.URL, token string, id string) {
func startRoom(room, server, proxy string, u *url.URL, id string) {
// curl -vvv -X POST -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" -H "X-Requested-With: XMLHttpRequest" -d "method=getRoomData" -d "args[]=Icehotangel" "https://rt.bongocams.com/tools/amf.php?res=771840&t=1654437233142"
fmt.Printf("token %s id %s\n", token, id)
fmt.Println("Start", room, "server", server, "proxy", proxy)
Dialer := *websocket.DefaultDialer
@ -88,12 +88,6 @@ func startRoom(room, server, proxy string, u *url.URL, token string, id string)
defer c.Close()
ws, _, err := Dialer.Dial("wss://websocket.stripchat.com/connection/websocket", nil)
if err != nil {
panic(err)
}
defer ws.Close()
for {
_, message, err := c.ReadMessage()
if err != nil {
@ -120,17 +114,13 @@ func startRoom(room, server, proxy string, u *url.URL, token string, id string)
return
}
}
if err = ws.WriteMessage(websocket.TextMessage, []byte(fmt.Sprintf(`{"params":{"token":"%s","name":"js"},"id":1}`, token))); err != nil {
panic(err)
}
}
if !strings.Contains(m.SubscriptionKey, "newChatMessage") {
continue
}
fmt.Println("proper msg")
if m.Params.Message.Type == "lovense" {
fmt.Println("donate")
fmt.Println(m.Params.Message.Details.LovenseDetails.Detail.Name, " send ", m.Params.Message.Details.LovenseDetails.Detail.Amount, "tokens")