From 944476594115a39a5b2e7f9f4b679398c32576e6 Mon Sep 17 00:00:00 2001 From: qydysky Date: Wed, 9 Jun 2021 01:53:52 +0800 Subject: [PATCH] =?utf8?q?=E4=BB=85=E5=85=81=E8=AE=B8=E6=89=8B=E5=8A=A8?= =?utf8?q?=E5=BC=B9=E5=B9=95=E9=87=8D=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- F/cmd.go | 6 ++++++ README.md | 3 ++- Reply/Reply.go | 9 +-------- 3 files changed, 9 insertions(+), 9 deletions(-) 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) -- 2.39.2