配置文件更新

This commit is contained in:
Muihd
2024-03-10 03:41:40 +08:00
parent 4e0a871833
commit 09ac7c3a9a
2 changed files with 81 additions and 34 deletions
+54 -31
View File
@@ -3,44 +3,67 @@
<!--配置更改后重启才能生效-->
<appSettings>
<!--过滤Websocket数据源进程,可用','进行分隔,程序将会监听以下进程的弹幕信息-->
<add key="processFilter" value="直播伴侣,douyin,chrome,msedge,QQBrowser,360se,firefox,2345explorer,iexplore"/>
<add key="processFilter" value="直播伴侣,douyin,chrome,msedge,QQBrowser,360se,firefox,2345explorer,iexplore" />
<!--Websocket监听端口-->
<add key="wsListenPort" value="8888"/>
<add key="wsListenPort" value="8888" />
<!--true:监听在0.0.0.0,接受任意Ip连接,false:监听在127.0.0.1,仅接受本机连接-->
<add key="listenAny" value="true"/>
<add key="listenAny" value="true" />
<!--系统代理端口-->
<add key="proxyPort" value="8827"/>
<!--上游代理地址,例如开启了系统代理,但是需要将其他无关请求转发到VPN工具中,例如:127.0.0.1:11223,不要带http://-->
<add key="upstreamProxy" value=""/>
<add key="proxyPort" value="8827" />
<!--上游代理地址,例如开启了系统代理,但是需要将其他无关请求转发到VPN工具中,例如:127.0.0.1:11223,不要带http://-->
<add key="upstreamProxy" value="" />
<!--在控制台输出弹幕-->
<add key="printBarrage" value="true"/>
<!--要在控制台打印的弹幕类型,可以用','隔开(空代表不过滤) 1[普通弹幕],2[点赞消息],3[进入直播间],4[关注消息],5[礼物消息],6[统计消息],7[粉丝团消息],8[直播间分享],9[下播]-->
<add key="printFilter" value=""/>
<!--要推送的弹幕消息类型,可以用','隔开,同上-->
<add key="pushFilter" value=""/>
<!--要日志记录的弹幕消息类型,可以用','隔开,同上-->
<add key="logFilter" value="1,2,4,5,6,7,8"/>
<add key="printBarrage" value="true" />
<!--要在控制台打印的弹幕类型,多个使用','分隔,(空代表不过滤) 1[普通弹幕],2[点赞消息],3[进入直播间],4[关注消息],5[礼物消息],6[统计消息],7[粉丝团消息],8[直播间分享],9[下播]-->
<add key="printFilter" value="" />
<!--要推送的弹幕消息类型,多个使用','分隔,同上-->
<add key="pushFilter" value="" />
<!--要日志记录的弹幕消息类型,多个使用','分隔,同上-->
<add key="logFilter" value="1,2,4,5,6,7,8" />
<!--要进行过滤的Web房间ID,多个使用','分隔,根据缓存来过滤的,直播伴侣不支持 -->
<add key="webRoomIds" value="940152769375" />
<!--是否启用系统代理,若设置为false 则需要在程序手动指定代理地址 -->
<add key="usedProxy" value="true"/>
<add key="usedProxy" value="true" />
<!--开启内置的域名过滤,设置为false会解包所有https请求,cpu占用很高,建议在无法获取弹幕数据时调整 -->
<add key="filterHostName" value="true"/>
<add key="filterHostName" value="true" />
<!--已知的弹幕域名列表 ','分隔 用作过滤规则中,凡是webcast开头的域名程序都会自动列入白名单-->
<add key="hostNameFilter" value=""/>
<!--要进行过滤的房间ID,不填代表监听所有,多项使用','分隔,浏览器进入直播间 F12 控制台输入 'window.localStorage.playRoom' 即可快速看到房间ID(不是地址栏中的那个) -->
<add key="roomIds" value=""/>
<!--隐藏控制台-->
<add key="hideConsole" value="false"/>
<add key="hostNameFilter" value="" />
<!--隐藏控制台-->
<add key="hideConsole" value="false" />
<!--弹幕文件日志-->
<add key="barrageFileLog" value="false"/>
<add key="barrageFileLog" value="false" />
<!--显示窗体-->
<add key="showWindow" value="false"/>
<add key="showWindow" value="false" />
<!--进入直播间自动暂停播放-->
<add key="autoPause" value="true"/>
<!--强制启用轮询模式获取弹幕 (对于容易断开连接或者更加追求稳定的直播间,可以启用这个开关,虽然响应速度不如WebSocket,但是绝对稳定!)-->
<add key="forcePolling" value="false"/>
<!--弹幕轮询间隔,当 forcePolling 为 true 时生效 (毫秒,1000毫秒=1秒,不建议小于1000毫秒,太小可能会被封IP,值越小,弹幕流越丝滑,对于观众多的直播间可以改小)-->
<add key="pollingInterval" value="3000"/>
<!--禁用直播页浏览器脚本缓存 (如果需要确保脚本每次能够正常匹配替换,则启用它,可能会损失一定的页面加载速度)-->
<add key="disableLivePageScriptCache" value="true"/>
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup></configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</configuration>
+27 -3
View File
@@ -29,13 +29,17 @@ namespace BarrageGrab
LogFilter = Enum.GetValues(typeof(PackMsgType)).Cast<int>().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
/// <summary>
/// 监听的房间号
/// </summary>
public long[] RoomIds { get; private set; } = new long[0];
public long[] WebRoomIds { get; private set; } = new long[0];
/// <summary>
/// 使用域名过滤
@@ -176,5 +180,25 @@ namespace BarrageGrab
/// 显示窗体
/// </summary>
public bool ShowWindow { get; private set; } = false;
/// <summary>
/// 进入直播间自动暂停播放
/// </summary>
public bool AutoPause { get; private set; } = false;
/// <summary>
/// 强制启用轮询模式获取弹幕(仅对浏览器和客户端生效)
/// </summary>
public bool ForcePolling { get; private set; } = false;
/// <summary>
/// 控制轮询间隔
/// </summary>
public int PollingInterval { get; private set; } = 1000;
/// <summary>
/// 禁用直播页面脚本缓存
/// </summary>
public bool DisableLivePageScriptCache { get; private set; } = true;
}
}