]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Improve state页流服务器添加创建时间
authorqydysky <qydysky@foxmail.com>
Tue, 18 Jun 2024 17:01:25 +0000 (17:01 +0000)
committerqydysky <qydysky@foxmail.com>
Tue, 18 Jun 2024 17:01:25 +0000 (17:01 +0000)
CV/Var.go
F/api.go

index 008bd37e58209a9a6f9fda454e2048befeda2b3e..722687b8d0d2ac11244edff89d57a1623c89622e 100644 (file)
--- a/CV/Var.go
+++ b/CV/Var.go
@@ -89,6 +89,7 @@ type LiveQn struct {
        Url          string `json:"-"`
        Codec        string
        ReUpTime     time.Time
+       CreateTime   time.Time
        DisableCount int
        Expires      time.Time //流到期时间
 }
@@ -98,6 +99,7 @@ func (t LiveQn) MarshalJSON() ([]byte, error) {
                Host         string
                Up           bool
                Codec        string
+               CreateTime   string
                ReUpTime     string
                Expires      string
                DisableCount int
@@ -105,6 +107,7 @@ func (t LiveQn) MarshalJSON() ([]byte, error) {
                Host:         t.Host(),
                Up:           time.Now().After(t.ReUpTime),
                Codec:        t.Codec,
+               CreateTime:   t.CreateTime.Format(time.DateTime),
                ReUpTime:     t.ReUpTime.Format(time.DateTime),
                Expires:      t.Expires.Format(time.DateTime),
                DisableCount: t.DisableCount,
index 07b6cae4bccfc2bde1683d189b7a31bc76fb7715..25343cf0c84a8bf0e82248ebe0c659773acac326 100644 (file)
--- a/F/api.go
+++ b/F/api.go
@@ -462,8 +462,9 @@ func (t *GetFunc) configStreamType(sts []struct {
                                        //直播流链接
                                        for _, v1 := range v.URLInfo {
                                                item := c.LiveQn{
-                                                       Codec: v.CodecName,
-                                                       Url:   v1.Host + v.BaseURL + v1.Extra,
+                                                       Codec:      v.CodecName,
+                                                       Url:        v1.Host + v.BaseURL + v1.Extra,
+                                                       CreateTime: time.Now(),
                                                }
 
                                                if query, e := url.ParseQuery(v1.Extra); e == nil {