]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
仅允许手动弹幕重载
authorqydysky <qydysky@foxmail.com>
Tue, 8 Jun 2021 17:53:52 +0000 (01:53 +0800)
committerqydysky <qydysky@foxmail.com>
Tue, 8 Jun 2021 17:53:52 +0000 (01:53 +0800)
F/cmd.go
README.md
Reply/Reply.go

index 9987990124d1ef3bfc5b6b3b6a0792a964e198af..40829cf602ea8f97113ee8270dc208cf40853732 100644 (file)
--- a/F/cmd.go
+++ b/F/cmd.go
@@ -31,6 +31,7 @@ func Cmd() {
                        } else {
                                fmt.Println("登陆->输入' login'回车")
                        }
+                       fmt.Println("重载弹幕->输入' reload'回车")
                        fmt.Println("搜索主播->输入' search关键词'回车")
                        fmt.Println("房间信息->输入' room'回车")
                        fmt.Println("开始结束录制->输入' rec'回车")
@@ -115,6 +116,11 @@ func Cmd() {
 
                                continue
                        }
+                       //重载弹幕
+                       if strings.Contains(inputs, ` reload`) {
+                               c.Danmu_Main_mq.Push_tag(`flash_room`,nil)
+                               continue
+                       }
                        //当前直播间信息
                        if strings.Contains(inputs, ` room`) {
                                fmt.Print("\n")
index 3965296b8ccf937c48e1cfe9c4be55dfd90a093d..31d54aca2cb2eb1fb2a1bfc0bc9ee812a08bca59 100644 (file)
--- a/README.md
+++ b/README.md
@@ -91,7 +91,8 @@ golang go version go1.15 linux/amd64
 
 - [x] 使用http代理
 - [x] cookie加密
-- [x] 弹幕自动重连(30s)
+- [x] 弹幕自动重连(30s无响应)
+- [x] 命令行重载弹幕
 - [x] 直播流开播自动下载
 - [x] 直播流断流再保存
 - [x] 直播hls流均衡负载
index 689f0057e3d98644de5bc936d9e7bacd57256d0b..fb421d482bcc557d522de4a19e518f7cfd9b6a30 100644 (file)
@@ -11,7 +11,6 @@ import (
 
        p "github.com/qydysky/part"
        mq "github.com/qydysky/part/msgq"
-       limit "github.com/qydysky/part/limit"
        F "github.com/qydysky/bili_danmu/F"
        ws_msg "github.com/qydysky/bili_danmu/Reply/ws_msg"
        send "github.com/qydysky/bili_danmu/Send"
@@ -784,7 +783,6 @@ func (replyF) roominfo(s string){
 }
 
 //Msg-弹幕处理
-var flash_limit = limit.New(1, 60000, -1)//-1 马上超时
 func (replyF) danmu(s string) {
        var j struct {
                Cmd  string        `json:"cmd"`
@@ -799,12 +797,7 @@ func (replyF) danmu(s string) {
        msg := infob[1].(string)
        auth := infob[2].([]interface{})[1]
        uid := strconv.Itoa(int(infob[2].([]interface{})[0].(float64)))
-       timeStramp := int64(infob[0].([]interface{})[4].(float64))
-       if t := p.Sys().GetMTime() - timeStramp; t > 60*1000 {
-               if flash_limit.TO() {return}
-               msglog.L(`W: `, `重进,弹幕时间戳偏离`, t, `ms`)
-               c.Danmu_Main_mq.Push_tag(`flash_room`,nil)
-       }
+       // timeStramp := int64(infob[0].([]interface{})[4].(float64))
 
        msglog := msglog.Log_show_control(false)