t.Roomid = j.RoomInitRes.Data.RoomID
}
//直播开始时间
- t.Live_Start_Time = time.Unix(int64(j.RoomInitRes.Data.LiveTime), 0)
+ if j.RoomInitRes.Data.LiveTime != 0 {
+ t.Live_Start_Time = time.Unix(int64(j.RoomInitRes.Data.LiveTime), 0)
+ }
//是否在直播
t.Liveing = j.RoomInitRes.Data.LiveStatus == 1
}
//直播开始时间
- c.Live_Start_Time = time.Unix(int64(j.Data.RoomInfo.LiveStartTime), 0)
+ if j.Data.RoomInfo.LiveStartTime != 0 {
+ c.Live_Start_Time = time.Unix(int64(j.Data.RoomInfo.LiveStartTime), 0)
+ }
//是否在直播
c.Liveing = j.Data.RoomInfo.LiveStatus == 1
//直播间标题
t.Roomid = j.Data.RoomID
}
//直播开始时间
- t.Live_Start_Time = time.Unix(int64(j.Data.LiveTime), 0)
+ if j.Data.LiveTime != 0 {
+ t.Live_Start_Time = time.Unix(int64(j.Data.LiveTime), 0)
+ }
//是否在直播
t.Liveing = j.Data.LiveStatus == 1
t.Roomid = j.Data.RoomID
}
//直播开始时间
- t.Live_Start_Time = time.Unix(int64(j.Data.LiveTime), 0)
+ if j.Data.LiveTime != 0 {
+ t.Live_Start_Time = time.Unix(int64(j.Data.LiveTime), 0)
+ }
//是否在直播
t.Liveing = j.Data.LiveStatus == 1
"github.com/dustin/go-humanize"
c "github.com/qydysky/bili_danmu/CV"
F "github.com/qydysky/bili_danmu/F"
+ _ "github.com/qydysky/bili_danmu/Reply/F"
send "github.com/qydysky/bili_danmu/Send"
p "github.com/qydysky/part"
--- /dev/null
+package f
+
+import (
+ _ "github.com/qydysky/bili_danmu/Reply/F/liveOver"
+)
--- /dev/null
+package liveOver
+
+import (
+ "context"
+ "fmt"
+ "time"
+
+ c "github.com/qydysky/bili_danmu/CV"
+ comp "github.com/qydysky/part/component"
+)
+
+func init() {
+ if e := comp.Put[c.Common](`bili_danmu.Reply.wsmsg.preparing.sumup`, sumup); e != nil {
+ panic(e)
+ }
+}
+
+func sumup(ctx context.Context, ptr *c.Common) error {
+ dura := time.Since(ptr.Live_Start_Time).Round(time.Second)
+ if ptr.Live_Start_Time.IsZero() {
+ dura = 0
+ }
+ ptr.Log.Base(`功能`, `下播总结`).L(`I: `, fmt.Sprintf("%d 时长 %s 总营收 ¥%.2f 观看人数 %d", ptr.Roomid, dura, ptr.Rev, ptr.Watched))
+ return nil
+}
import (
"bytes"
"compress/zlib"
+ "context"
"encoding/json"
"fmt"
"strconv"
ws_msg "github.com/qydysky/bili_danmu/Reply/ws_msg"
send "github.com/qydysky/bili_danmu/Send"
p "github.com/qydysky/part"
+ comp "github.com/qydysky/part/component"
mq "github.com/qydysky/part/msgq"
pstrings "github.com/qydysky/part/strings"
)
// 停止此房间录制
var roomId, _ = strconv.Atoi(type_item.Roomid)
StreamOStop(roomId)
+ // 下播总结
+ if e := comp.Run(`bili_danmu.Reply.wsmsg.preparing`, context.Background(), c.C); e != nil {
+ msglog.L(`E: `, e)
+ }
}
Gui_show("房间", type_item.Roomid, "下播了", "0room")
msglog.L(`I: `, "房间", type_item.Roomid, "下播了")
require (
github.com/gotk3/gotk3 v0.6.2
github.com/mdp/qrterminal/v3 v3.1.1
- github.com/qydysky/part v0.28.1-0.20230719070824-1cd4290c29fe
+ github.com/qydysky/part v0.28.1-0.20230725023755-f30bbfd028ab
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
golang.org/x/text v0.11.0
modernc.org/sqlite v1.23.1
rsc.io/qr v0.2.0 // indirect
)
+
+// replace github.com/qydysky/part => ../part
github.com/miekg/dns v1.1.55 h1:GoQ4hpsj0nFLYe+bWiCToyrBEJXkQfOOIvFGFy0lEgo=
github.com/miekg/dns v1.1.55/go.mod h1:uInx36IzPl7FYnDcMeVWxj9byh7DutNykX4G9Sj60FY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
-github.com/qydysky/part v0.28.1-0.20230719070824-1cd4290c29fe h1:5WmdnH9qJ5ytpev9LqKHxCarmu09RLDKRQ4v/ADNgqM=
-github.com/qydysky/part v0.28.1-0.20230719070824-1cd4290c29fe/go.mod h1:CdkAHZ+OxieG1sI4M6UowP9j0QQDnhtDtN4tWsylCPU=
+github.com/qydysky/part v0.28.1-0.20230725023755-f30bbfd028ab h1:f3WoAYWdM4lossSsVpwMCcJ3oIdYHu+2L+svH92AG58=
+github.com/qydysky/part v0.28.1-0.20230725023755-f30bbfd028ab/go.mod h1:CdkAHZ+OxieG1sI4M6UowP9j0QQDnhtDtN4tWsylCPU=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=