]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Add 添加配置 弹幕回放_隐藏发送人
authorqydysky <qydysky@foxmail.com>
Sun, 6 Oct 2024 13:12:56 +0000 (21:12 +0800)
committerqydysky <qydysky@foxmail.com>
Sun, 6 Oct 2024 13:12:56 +0000 (21:12 +0800)
Reply/F.go
Reply/Reply.go
demo/config/config_K_v.json

index c103d643c50acc1f77f7390889e6797901d41596..c69eb6d8e462f41fdc0c26feb3c068486e5a4fe7 100644 (file)
@@ -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
index 685241899b652681b3b82d6c2eff7e960802b57e..c8faf8ec6a1e3afe006eb56c8b833c456a092150 100644 (file)
@@ -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)
index 31d28857baa8ab44713812ba449b270bac301017..9270fe6e1acb65e5fcdadb0b2ef5849c011804db 100644 (file)
     "直播Web可以发送弹幕":true,
     "弹幕回放-help": "仅保存当前直播间流为true时才有效",
     "弹幕回放": true,
+    "弹幕回放_隐藏发送人-help": "回放弹幕文件类型记录(ass,xml,csv...)不记录发送人,但不影响`保存弹幕至db`等日志类型记录,默认为false",
+    "弹幕回放_隐藏发送人": false,
     "直播流回放速率-help": "速率为每秒速率 例最小值(1 MB)",
     "直播流回放速率": "2 MB",
     "直播流回放连接检查-help": "默认-1,小于1禁用。指最多支持n连接流,有效数时,会对回放连接进行定时检查。原因,对于经过代理回放,有可能浏览器标签页已经关闭,但代理不关闭连接,导致连接不能释放",