From 09ac7c3a9a7b2554d7920abe58b0eab1b8d28d40 Mon Sep 17 00:00:00 2001 From: Muihd <1083092844@qq.com> Date: Sun, 10 Mar 2024 03:41:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BarrageGrab/App.config | 85 +++++++++++++++++++++++++-------------- BarrageGrab/Appsetting.cs | 30 ++++++++++++-- 2 files changed, 81 insertions(+), 34 deletions(-) diff --git a/BarrageGrab/App.config b/BarrageGrab/App.config index b7d6d28..ee3ea0f 100644 --- a/BarrageGrab/App.config +++ b/BarrageGrab/App.config @@ -3,44 +3,67 @@ - + - + - + - - - + + + - - - - - - - + + + + + + + + + - + - + - - - - - + + + - + - + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BarrageGrab/Appsetting.cs b/BarrageGrab/Appsetting.cs index 6992f45..9890e5c 100644 --- a/BarrageGrab/Appsetting.cs +++ b/BarrageGrab/Appsetting.cs @@ -29,13 +29,17 @@ namespace BarrageGrab LogFilter = Enum.GetValues(typeof(PackMsgType)).Cast().Where(w => w > 0).ToArray(); FilterHostName = bool.Parse(AppSettings["filterHostName"].Trim()); HostNameFilter = AppSettings["hostNameFilter"].Trim().Split(',').Where(w => !string.IsNullOrWhiteSpace(w)).ToArray(); - RoomIds = AppSettings["roomIds"].Trim().Split(',').Where(w => !string.IsNullOrWhiteSpace(w)).Select(s => long.Parse(s)).ToArray(); UsedProxy = bool.Parse(AppSettings["usedProxy"].Trim()); ListenAny = bool.Parse(AppSettings["listenAny"].Trim()); UpstreamProxy = AppSettings["upstreamProxy"].Trim(); HideConsole = bool.Parse(AppSettings["hideConsole"].Trim()); BarrageLog = bool.Parse(AppSettings["barrageFileLog"].Trim()); ShowWindow = bool.Parse(AppSettings["showWindow"].Trim()); + AutoPause = bool.Parse(AppSettings["autoPause"].Trim()); + ForcePolling = bool.Parse(AppSettings["forcePolling"].Trim()); + PollingInterval = int.Parse(AppSettings["pollingInterval"].Trim()); + DisableLivePageScriptCache = bool.Parse(AppSettings["disableLivePageScriptCache"].Trim()); + WebRoomIds = AppSettings["webRoomIds"].Trim().Split(',').Where(w=>!string.IsNullOrWhiteSpace(w)).Select(x => long.Parse(x)).ToArray(); var printFilter = AppSettings["printFilter"].Trim().ToLower(); var pushFilter = AppSettings["pushFilter"].Trim().ToLower(); @@ -58,7 +62,7 @@ namespace BarrageGrab } catch (Exception ex) { - Console.WriteLine("配置文件读取失败,请检查配置文件是否正确"); + Logger.PrintColor("配置文件读取失败,请检查配置文件是否正确"); throw ex; } } @@ -145,7 +149,7 @@ namespace BarrageGrab /// /// 监听的房间号 /// - public long[] RoomIds { get; private set; } = new long[0]; + public long[] WebRoomIds { get; private set; } = new long[0]; /// /// 使用域名过滤 @@ -176,5 +180,25 @@ namespace BarrageGrab /// 显示窗体 /// public bool ShowWindow { get; private set; } = false; + + /// + /// 进入直播间自动暂停播放 + /// + public bool AutoPause { get; private set; } = false; + + /// + /// 强制启用轮询模式获取弹幕(仅对浏览器和客户端生效) + /// + public bool ForcePolling { get; private set; } = false; + + /// + /// 控制轮询间隔 + /// + public int PollingInterval { get; private set; } = 1000; + + /// + /// 禁用直播页面脚本缓存 + /// + public bool DisableLivePageScriptCache { get; private set; } = true; } }