From: qydysky Date: Tue, 20 Oct 2020 04:04:54 +0000 (+0800) Subject: 修正无cookie时无法下载直播流及显示弹幕窗口 X-Git-Tag: v0.4.0~2^2 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=fa7c0ba37d6ab1141a1dfe4871095ff876affd93;p=bili_danmu%2F.git 修正无cookie时无法下载直播流及显示弹幕窗口 --- diff --git a/Reply/F.go b/Reply/F.go index 1a45348..d124221 100644 --- a/Reply/F.go +++ b/Reply/F.go @@ -46,7 +46,7 @@ var AllF = map[string]bool{ //从config.json初始化 func init(){ buf := s.New() - buf.Load("config.json") + buf.Load("config_F.json") for k,v := range buf.B { AllF[k] = v.(bool) } diff --git a/bili_danmu.go b/bili_danmu.go index ba8b443..5063046 100644 --- a/bili_danmu.go +++ b/bili_danmu.go @@ -79,21 +79,24 @@ func Demo(roomid ...int) { ws.Heartbeat(1000 * heartinterval, heartbeatmsg) //打招呼 + var q = p.Filel{ + Write:false, + } if p.Checkfile().IsExist("cookie.txt") { - f := p.File().FileWR(p.Filel{ - File:"cookie.txt", - Write:false, - }) - //传输变量,以便响应弹幕"弹幕机在么" - c.Roomid = api.Roomid - c.Live = api.Live - c.Cookie = f - {//附加功能 弹幕机 直播流保存 Qt窗口 Gtk窗口 - reply.Danmuji_auto(1) - go reply.Saveflvf() - go reply.Qtdf() - go reply.Gtkf() - } + q.File = "cookie.txt" + } + f := p.File().FileWR(q) + //传输变量,以便响应弹幕"弹幕机在么" + c.Roomid = api.Roomid + c.Live = api.Live + c.Cookie = f + if p.Checkfile().IsExist("cookie.txt") {//附加功能 弹幕机 + reply.Danmuji_auto(1) + } + {//附加功能 直播流保存 Qt窗口 Gtk窗口 + go reply.Saveflvf() + go reply.Qtdf() + go reply.Gtkf() } }() } diff --git a/demo/config.json b/demo/config_F.json similarity index 100% rename from demo/config.json rename to demo/config_F.json