下播记录时间
This commit is contained in:
parent
ad6b606f33
commit
0f741e5ee9
@ -5,6 +5,7 @@ import json
|
||||
import logging
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
from typing import *
|
||||
|
||||
import aiohttp
|
||||
@ -143,6 +144,9 @@ class JsonlLogger(blivedm.BaseHandler):
|
||||
if client.room_id not in log_files:
|
||||
log_files[client.room_id] = open(f"logs/{client.room_id}.jsonl", "a", encoding="utf-8")
|
||||
|
||||
if "cmd" in message and message["cmd"] == "PREPARING":
|
||||
message["timestamp"] = int(time.time())
|
||||
|
||||
log_files[client.room_id].write(f"{json.dumps(message, separators=(',', ':'), ensure_ascii=False)}\n")
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user