From: qydysky Date: Sun, 6 Oct 2024 13:12:56 +0000 (+0800) Subject: Add 添加配置 弹幕回放_隐藏发送人 X-Git-Tag: v0.14.20~2 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=42e97278faa6205cd1dac4053516e1959fd04f09;p=bili_danmu%2F.git Add 添加配置 弹幕回放_隐藏发送人 --- diff --git a/Reply/F.go b/Reply/F.go index c103d64..c69eb6d 100644 --- a/Reply/F.go +++ b/Reply/F.go @@ -1079,7 +1079,7 @@ var StreamWs = websocket.New_server() func SendStreamWs(item Danmu_item) { var msg string - if item.auth != nil { + if item.auth != nil && !item.hideAuth { msg += fmt.Sprint(item.auth) + `: ` } msg += item.msg diff --git a/Reply/Reply.go b/Reply/Reply.go index 6852418..c8faf8e 100644 --- a/Reply/Reply.go +++ b/Reply/Reply.go @@ -1254,13 +1254,14 @@ func (t replyF) roomsilent(s string) { // Msg-弹幕处理 type Danmu_item struct { - msg string - color string - border bool - mode int - auth any - uid string - roomid int //to avoid danmu show when room has changed + msg string + color string + border bool + mode int + auth any + hideAuth bool + uid string + roomid int //to avoid danmu show when room has changed } func (t replyF) danmu(s string) { @@ -1275,6 +1276,9 @@ func (t replyF) danmu(s string) { infob := j.Info item := Danmu_item{} + if v, ok := t.Common.K_v.LoadV(`弹幕回放_隐藏发送人`).(bool); ok && v { + item.hideAuth = true + } { //解析 if len(infob) > 0 { @@ -1402,7 +1406,7 @@ func Msg_showdanmu(item Danmu_item) { //直播流服务弹幕 SendStreamWs(item) - if item.auth != nil { + if item.auth != nil && !item.hideAuth { Gui_show(fmt.Sprint(item.auth)+`: `+item.msg, item.uid) } else { Gui_show(item.msg, item.uid) diff --git a/demo/config/config_K_v.json b/demo/config/config_K_v.json index 31d2885..9270fe6 100644 --- a/demo/config/config_K_v.json +++ b/demo/config/config_K_v.json @@ -153,6 +153,8 @@ "直播Web可以发送弹幕":true, "弹幕回放-help": "仅保存当前直播间流为true时才有效", "弹幕回放": true, + "弹幕回放_隐藏发送人-help": "回放弹幕文件类型记录(ass,xml,csv...)不记录发送人,但不影响`保存弹幕至db`等日志类型记录,默认为false", + "弹幕回放_隐藏发送人": false, "直播流回放速率-help": "速率为每秒速率 例最小值(1 MB)", "直播流回放速率": "2 MB", "直播流回放连接检查-help": "默认-1,小于1禁用。指最多支持n连接流,有效数时,会对回放连接进行定时检查。原因,对于经过代理回放,有可能浏览器标签页已经关闭,但代理不关闭连接,导致连接不能释放",