From 5845a336ef57d92a1e1a338fcbd686c9562a68ff Mon Sep 17 00:00:00 2001 From: liuwei Date: Tue, 24 Feb 2026 17:37:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=97=E9=B1=BC=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E5=9C=A8=E7=9B=B4=E6=92=AD=E7=9A=84=E4=B8=BB?= =?UTF-8?q?=E6=92=AD=E4=B8=8D=E5=BD=95=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/douyu/main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/douyu/main.py b/plugins/douyu/main.py index 91abc9a..6be5ada 100644 --- a/plugins/douyu/main.py +++ b/plugins/douyu/main.py @@ -35,7 +35,7 @@ class DouyuDanmuRecorder: self._stop_event = threading.Event() self._ws: Optional[websocket.WebSocketApp] = None self._buffer: List[str] = [] - self._buffer_limit = 50 + self._buffer_limit = 10 self._buffer_date: Optional[str] = None self._lock = threading.Lock() self._websocket_available = websocket is not None @@ -542,6 +542,13 @@ class DouyuPlugin(MessagePluginInterface): if prev_live is True and curr_live is False: await self._notify_groups_offline(room_id, nickname, room_name, video_loop == 1) continue + if prev_live is True and curr_live is True and room_id not in self._danmu_recorders: + try: + logger.info(f"检测到持续直播状态,补偿启动斗鱼弹幕记录({room_id})") + self._start_danmu_record(room_id) + except Exception as e: + logger.error(f"补偿启动斗鱼弹幕记录失败({room_id}): {e}") + continue await asyncio.sleep(0.1) except Exception as e: logger.error(f"斗鱼检查失败: {e}")