import (
"crypto/md5"
- "encoding/json"
"errors"
"fmt"
"net/http"
cmp "github.com/qydysky/part/component2"
file "github.com/qydysky/part/file"
funcCtrl "github.com/qydysky/part/funcCtrl"
- g "github.com/qydysky/part/get"
pio "github.com/qydysky/part/io"
limit "github.com/qydysky/part/limit"
reqf "github.com/qydysky/part/reqf"
return
}
- Roomid := strconv.Itoa(t.Roomid)
-
//html
{
- r := g.Get(reqf.Rval{
- Url: "https://live.bilibili.com/" + Roomid,
- Proxy: t.Proxy,
- })
- if tmp := r.S(`<script>window.__NEPTUNE_IS_MY_WAIFU__=`, `</script>`, 0, 0); tmp.Err != nil {
- apilog.L(`E: `, `不存在<script>window.__NEPTUNE_IS_MY_WAIFU__= </script>`)
+ if err, j := biliApi.LiveHtml(t.Roomid); err != nil {
+ apilog.L(`E: `, err)
+ return
} else {
- s := tmp.RS[0]
-
- var j J.NEPTUNE_IS_MY_WAIFU
- if e := json.Unmarshal([]byte(s), &j); e != nil {
- apilog.L(`E: `, e)
- return
- } else if j.RoomInitRes.Code != 0 {
- apilog.L(`E: `, j.RoomInitRes.Message)
- return
- }
//Roominitres
{
//主播uid
}
// 配置直播流
-func (t *GetFunc) configStreamType(sts []J.StreamType) {
+func (t *GetFunc) configStreamType(sts []struct {
+ ProtocolName string
+ Format []struct {
+ FormatName string
+ Codec []struct {
+ CodecName string
+ CurrentQn int
+ AcceptQn []int
+ BaseURL string
+ URLInfo []struct {
+ Host string
+ Extra string
+ StreamTTL int
+ }
+ HdrQn any
+ DolbyType int
+ AttrName string
+ }
+ }
+}) {
var (
wantTypes []c.StreamType
chosen int = -1
}
//当前直播流
- var s = make([]J.StreamType, len(res.Streams))
+ var s = make([]struct {
+ ProtocolName string
+ Format []struct {
+ FormatName string
+ Codec []struct {
+ CodecName string
+ CurrentQn int
+ AcceptQn []int
+ BaseURL string
+ URLInfo []struct {
+ Host string
+ Extra string
+ StreamTTL int
+ }
+ HdrQn any
+ DolbyType int
+ AttrName string
+ }
+ }
+ }, len(res.Streams))
for i := 0; i < len(res.Streams); i++ {
- s[i] = J.StreamType(res.Streams[i])
+ s[i] = struct {
+ ProtocolName string
+ Format []struct {
+ FormatName string
+ Codec []struct {
+ CodecName string
+ CurrentQn int
+ AcceptQn []int
+ BaseURL string
+ URLInfo []struct {
+ Host string
+ Extra string
+ StreamTTL int
+ }
+ HdrQn any
+ DolbyType int
+ AttrName string
+ }
+ }
+ }(res.Streams[i])
}
t.configStreamType(s)
}
}
//当前直播流
- var s = make([]J.StreamType, len(res.Streams))
+ var s = make([]struct {
+ ProtocolName string
+ Format []struct {
+ FormatName string
+ Codec []struct {
+ CodecName string
+ CurrentQn int
+ AcceptQn []int
+ BaseURL string
+ URLInfo []struct {
+ Host string
+ Extra string
+ StreamTTL int
+ }
+ HdrQn any
+ DolbyType int
+ AttrName string
+ }
+ }
+ }, len(res.Streams))
for i := 0; i < len(res.Streams); i++ {
- s[i] = J.StreamType(res.Streams[i])
+ s[i] = struct {
+ ProtocolName string
+ Format []struct {
+ FormatName string
+ Codec []struct {
+ CodecName string
+ CurrentQn int
+ AcceptQn []int
+ BaseURL string
+ URLInfo []struct {
+ Host string
+ Extra string
+ StreamTTL int
+ }
+ HdrQn any
+ DolbyType int
+ AttrName string
+ }
+ }
+ }(res.Streams[i])
}
t.configStreamType(s)
}
github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/qydysky/biliApi v0.0.0-20240512142342-157ceab517d0 h1:t4plypquYcyTTuyq6BGglvh05S7RrHFgD80zq9ILHgQ=
-github.com/qydysky/biliApi v0.0.0-20240512142342-157ceab517d0/go.mod h1:om024vfxALQ5vxsbaGoMm8IS0esLYBnEOpJI8FsGoDg=
+github.com/qydysky/biliApi v0.0.0-20240513191013-9035390b13c0 h1:mPP9ElJlVbXG7st/11LrIRw8zF8lEzagalzO4Nz9EHM=
+github.com/qydysky/biliApi v0.0.0-20240513191013-9035390b13c0/go.mod h1:om024vfxALQ5vxsbaGoMm8IS0esLYBnEOpJI8FsGoDg=
github.com/qydysky/part v0.28.20240501130702 h1:0riRs+hY628Hd3ohvxAgDN9GL0GpqgPe/G/YIPn8JiQ=
github.com/qydysky/part v0.28.20240501130702/go.mod h1:VMq3GnrK1/7zUufW3foG5oLAk9dw567JmuMyKPTGswc=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=