From: qydysky Date: Tue, 8 Jun 2021 17:53:52 +0000 (+0800) Subject: 仅允许手动弹幕重载 X-Git-Tag: v0.5.10~41^2~115 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=944476594115a39a5b2e7f9f4b679398c32576e6;p=bili_danmu%2F.git 仅允许手动弹幕重载 --- diff --git a/F/cmd.go b/F/cmd.go index 9987990..40829cf 100644 --- 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") diff --git a/README.md b/README.md index 3965296..31d54ac 100644 --- 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流均衡负载 diff --git a/Reply/Reply.go b/Reply/Reply.go index 689f005..fb421d4 100644 --- a/Reply/Reply.go +++ b/Reply/Reply.go @@ -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)