branches:
- 'master'
paths:
- - 'VERSION'
+ - 'CV/VERSION'
jobs:
buildtest:
run: |
sudo apt-get update
sudo apt-get install libgtk-3-dev libcairo2-dev libglib2.0-dev
- git rev-parse --short HEAD > VERSION
+ git rev-parse --short HEAD > CV/VERSION
cd demo
go get .
CGO_ENABLED=0 go build -pgo=auto -v -buildmode=exe -o demo.run main.go
- name: Build
run: |
- git rev-parse --short HEAD > VERSION
+ git rev-parse --short HEAD > CV/VERSION
cd demo
set CGO_ENABLED=0
go get .
- name: Build
run: |
- git rev-parse --short HEAD > VERSION
+ git rev-parse --short HEAD > CV/VERSION
cd demo
sudo apt-get update
sudo apt-get install libgtk-3-dev libcairo2-dev libglib2.0-dev
- name: Build
run: |
- git rev-parse --short HEAD > VERSION
+ git rev-parse --short HEAD > CV/VERSION
cd demo
go get .
set CGO_ENABLED=0
import (
"context"
"database/sql"
+ _ "embed"
"encoding/json"
"errors"
"flag"
_ "modernc.org/sqlite"
)
+//go:embed VERSION
+var version string
+
type StreamType struct {
Protocol_name string
Format_name string
type Common struct {
PID int `json:"pid"` //进程id
+ Version string `json:"version"` //版本
Uid int `json:"-"` //client uid
Live []LiveQn `json:"-"` //直播流链接
Live_qn int `json:"liveQn"` //当前直播流质量
func (t *Common) Copy() *Common {
var c = Common{
PID: t.PID,
+ Version: t.Version,
Uid: t.Uid,
Live: t.Live,
Live_qn: t.Live_qn,
func (t *Common) Init() *Common {
t.PID = os.Getpid()
+ t.Version = version
t.StartT = time.Now()
t.AllStreamType = map[string]StreamType{
gcAvgS = time.Since(t.StartT).Seconds() / float64(memStats.NumGC)
}
- reqState := t.ReqPool.PoolState()
+ reqState := t.ReqPool.State()
ResStruct{0, "ok", map[string]any{
+ "version": strings.TrimSpace(t.Version),
"startTime": t.StartT.Format(time.DateTime),
"currentTime": time.Now().Format(time.DateTime),
"state": map[string]any{
"base": map[string]any{
"reqPoolState": map[string]any{
- "pooled": reqState[0],
- "nopooled": reqState[1],
- "inuse": reqState[2],
- "nouse": reqState[3],
- "sum": reqState[4],
- "qts": math.Round(reqState[5].(float64)*100) / 100,
+ "pooled": reqState.Pooled,
+ "nopooled": reqState.Nopooled,
+ "inuse": reqState.Inuse,
+ "nouse": reqState.Nouse,
+ "sum": reqState.Sum,
+ "qts": math.Round(reqState.GetPerSec*100) / 100,
},
"numGoroutine": runtime.NumGoroutine(),
"goVersion": runtime.Version(),
var obj = `{"uid":` + strconv.Itoa(c.C.Uid) +
`,"roomid":` + strconv.Itoa(roomid) +
- `,"protover":` + strconv.Itoa(c.Protover) +
- `,"platform":"` + c.Platform +
+ `,"protover":` + strconv.Itoa(c.Protover)
+
+ if buvid, ok := c.C.Cookie.LoadV("buvid3").(string); ok {
+ obj += `,"buvid":"` + buvid + `"`
+ }
+
+ obj += `,"platform":"` + c.Platform +
// `","clientver":"` + c.VERSION + //delete at 2021 4 14
`","type":` + strconv.Itoa(c.Type) +
`,"key":"` + key + `"}`
## bilibili 直播弹幕机
[](https://goreportcard.com/report/github.com/qydysky/bili_danmu)
[](https://codecov.io/gh/qydysky/bili_danmu)
-[](https://libraries.io/go/github.com%2Fqydysky%2Fbili_danmu)
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fqydysky%2Fbili_danmu?ref=badge_small)
[](https://r.qydysky.org/bili)
return
case <-ticker.C:
}
- t.log.L(`T: `, fmt.Sprintf("m4sPoolState pooled/no(%d/%d), inuse/no(%d/%d), sum(%d), qts(%.2f)", t.m4s_pool.PoolState()...))
+ reqState := t.m4s_pool.State()
+ t.log.L(`T: `, fmt.Sprintf("m4sPoolState pooled/no(%d/%d), inuse/no(%d/%d), sum(%d), qts(%.2f)",
+ reqState.Pooled, reqState.Nopooled, reqState.Inuse, reqState.Nouse, reqState.Sum, reqState.GetPerSec))
}
}()
}
"os"
"os/signal"
"strconv"
- "strings"
"time"
c "github.com/qydysky/bili_danmu/CV"
ws "github.com/qydysky/part/websocket"
)
-//go:embed VERSION
-var version string
-
func Start() {
danmulog := c.C.Log.Base(`bilidanmu`)
danmulog.L(`I: `, `当前PID:`, c.C.PID)
- danmulog.L(`I: `, "version: ", strings.TrimSpace(version))
+ danmulog.L(`I: `, "version: ", c.C.Version)
//检查配置
if c.C.K_v.Len() == 0 {
require (
github.com/gotk3/gotk3 v0.6.2
github.com/mdp/qrterminal/v3 v3.2.0
- github.com/qydysky/part v0.28.20231215215733
+ github.com/qydysky/part v0.28.20240101151147
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.14.0
github.com/miekg/dns v1.1.57/go.mod h1:uqRjCRUuEAA6qsOiJvDd+CFo/vW+y5WR6SNmHE55hZk=
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/part v0.28.20231215215733 h1:qxbqSdoLUBG6o2VkKxM1IAaXoCQZcgLcmierFW9zwvc=
-github.com/qydysky/part v0.28.20231215215733/go.mod h1:NyKyjpBCSjcHtKlC+fL5lCidm57UCnwEgufiBDs5yxA=
+github.com/qydysky/part v0.28.20240101151147 h1:ugiSjvUjGWjdWGN3nJppcNAxGPHccFkUtDTcqnfUvJ4=
+github.com/qydysky/part v0.28.20240101151147/go.mod h1:NyKyjpBCSjcHtKlC+fL5lCidm57UCnwEgufiBDs5yxA=
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=