]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
修正无cookie时无法下载直播流及显示弹幕窗口
authorqydysky <qydysky@foxmail.com>
Tue, 20 Oct 2020 04:04:54 +0000 (12:04 +0800)
committerqydysky <qydysky@foxmail.com>
Tue, 20 Oct 2020 04:04:54 +0000 (12:04 +0800)
Reply/F.go
bili_danmu.go
demo/config_F.json [moved from demo/config.json with 100% similarity]

index 1a45348da869fbc233f7abdf502ec3e76717157e..d124221fde31b94fb7a5906e2a577e4969dcadaa 100644 (file)
@@ -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)
        }
index ba8b44341b0d8a2cf9f3b1d16ee62a7a33f134dc..50630467874d71812a6597a0497cfdcce0ccf255 100644 (file)
@@ -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()
                                                }
                                        }()
                                }
similarity index 100%
rename from demo/config.json
rename to demo/config_F.json