$ git clone http://tcclient.ion.nu/tc_client.git
commit 48fc1059076e88eb844d28a23aa3c6c1d00f18e7
Author: Alicia <...>
Date:   Sat Jul 15 20:46:21 2017 +0000

    Added support for the tinychat beta commands sysmsg and yut_play (start youtube video)

diff --git a/ChangeLog b/ChangeLog
index 8e1df94..0146147 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@ Use curl's curl_easy_unescape() for from_owner notices instead of doing it ourse
 Added some basic support for tinychat beta (-s/--site tinychat_beta)
 Automatically use tinychat_beta for beta channels.
 If joining a tinychat beta channel when the client was built without support for it (requires libwebsocket, json-c), print a warning and continue connecting on RTMP.
+Added support for the tinychat beta commands sysmsg and yut_play (start youtube video)
 modbot: use https instead of http and use the tcclient subdomain since some DNSes have trouble with underscores.
 modbot: added an option (--no-unapproved) to not add any unapproved videos to queue (videos still get approved by mods requesting or playing them manually)
 tc_client-gtk: fixed a race-condition in the builtin video player.
diff --git a/tinychat_beta.c b/tinychat_beta.c
index c9ecd4e..1b1f929 100644
--- a/tinychat_beta.c
+++ b/tinychat_beta.c
@@ -135,6 +135,24 @@ static void handlepacket(websock_conn* conn, void* data, struct websock_head* he
     const char* nick=idlist_getnick(handle);
     printf("%s %s left the channel\n", timestamp(), nick);
     idlist_removeid(handle);
+  }
+  else if(!strcmp(cmd, "sysmsg"))
+  {
+    if(!json_object_object_get_ex(obj, "text", &cmdobj)){json_object_put(obj); return;}
+    const char* text=json_object_get_string(cmdobj);
+    printf("%s %s\n", timestamp(), text);
+  }
+  else if(!strcmp(cmd, "yut_play"))
+  {
+    if(!json_object_object_get_ex(obj, "success", &cmdobj)){json_object_put(obj); return;}
+    if(!json_object_get_boolean(cmdobj)){json_object_put(obj); return;} // Ignore failed media actions
+    struct json_object* item;
+    if(!json_object_object_get_ex(obj, "item", &item)){json_object_put(obj); return;}
+    if(!json_object_object_get_ex(item, "id", &cmdobj)){json_object_put(obj); return;}
+    const char* id=json_object_get_string(cmdobj);
+    if(!json_object_object_get_ex(item, "offset", &cmdobj)){json_object_put(obj); return;}
+    int64_t offset=json_object_get_int64(cmdobj)*1000; // Milliseconds
+    printf("Media start: youtube(%s) %llu\n", id, offset);
   }else{
     write(1, "Received: ", 10);
     write(1, data, head->length);