if !t.Liveing {
t.Live_qn = 0
t.AcceptQn = t.Qn
- t.Live = []c.LiveQn{}
+ clear(t.Live)
return
}
t.AcceptQn = tmp
}
//直播流链接
- t.Live = []c.LiveQn{}
+ clear(t.Live)
for _, v1 := range v.URLInfo {
item := c.LiveQn{
Url: v1.Host + v.BaseURL + v1.Extra,
t.AcceptQn = tmp
}
//直播流链接
- t.Live = []c.LiveQn{}
+ clear(t.Live)
for _, v1 := range v.URLInfo {
item := c.LiveQn{
Url: v1.Host + v.BaseURL + v1.Extra,
if !t.Liveing {
t.Live_qn = 0
t.AcceptQn = t.Qn
- t.Live = []c.LiveQn{}
+ clear(t.Live)
return
}
if !t.Liveing {
t.Live_qn = 0
t.AcceptQn = t.Qn
- t.Live = []c.LiveQn{}
+ clear(t.Live)
return
}
t.Fatal()
}
}
+
+func Test_Html(t *testing.T) {
+ //获取cookie
+ Get(c.C).Get(`Cookie`)
+ //获取LIVE_BUVID
+ Get(c.C).Get(`LIVE_BUVID`)
+ c.C.Roomid = 394988
+ c.C.UpUid = 0
+ Get(c.C).Html()
+ if c.C.UpUid == 0 {
+ t.Fatal()
+ }
+}
+
+func Test_getRoomPlayInfo(t *testing.T) {
+ //获取cookie
+ Get(c.C).Get(`Cookie`)
+ //获取LIVE_BUVID
+ Get(c.C).Get(`LIVE_BUVID`)
+ c.C.Roomid = 394988
+ c.C.UpUid = 0
+ Get(c.C).getRoomPlayInfo()
+ if c.C.UpUid == 0 {
+ t.Fatal()
+ }
+}
+
+func Test_getRoomPlayInfoByQn(t *testing.T) {
+ //获取cookie
+ Get(c.C).Get(`Cookie`)
+ //获取LIVE_BUVID
+ Get(c.C).Get(`LIVE_BUVID`)
+ c.C.Roomid = 394988
+ c.C.UpUid = 0
+ Get(c.C).getRoomPlayInfoByQn()
+ if c.C.UpUid == 0 {
+ t.Fatal()
+ }
+}
+
+func Test_getDanmuInfo(t *testing.T) {
+ //获取cookie
+ Get(c.C).Get(`Cookie`)
+ //获取LIVE_BUVID
+ Get(c.C).Get(`LIVE_BUVID`)
+ c.C.Roomid = 394988
+ c.C.WSURL = []string{}
+ Get(c.C).getDanmuInfo()
+ if len(c.C.WSURL) == 0 {
+ t.Fatal()
+ }
+}
+
+func Test_Get_guardNum(t *testing.T) {
+ //获取cookie
+ Get(c.C).Get(`Cookie`)
+ //获取LIVE_BUVID
+ Get(c.C).Get(`LIVE_BUVID`)
+ c.C.Roomid = 394988
+ c.C.GuardNum = -1
+ Get(c.C).Html()
+ Get(c.C).Get_guardNum()
+ if c.C.GuardNum == -1 {
+ t.Fatal()
+ }
+}
// if sign != 0x00 {
// fmt.Printf("front_buf error:%x\n", sign)
// }
- front_buf = []byte{}
+ clear(front_buf)
}
if bufl := keyframe.Size(); confirm_num != bufl {
_ = keyframe.RemoveBack(bufl - confirm_num)
ies, e := decode(buf, "moof")
if e != nil {
- return
+ return 0, e
}
err = deals(ies,
err = E
if reSyncI := bytes.Index(buf[cu:], []byte(reSyncboxName)); reSyncI != -1 {
cu += reSyncI - 4
- m = []ie{}
+ clear(m)
continue
}
err = errors.New(E.Error() + " > 未能reSync")
if index := bytes.Index(m3u8_addon, []byte(m4s_link.Base)); index != -1 {
index += len([]byte(m4s_link.Base))
if index == len(m3u8_addon) {
- m3u8_addon = []byte{}
+ clear(m3u8_addon)
} else {
m3u8_addon = m3u8_addon[index+1:]
}