// "runtime"
+ humanize "github.com/dustin/go-humanize"
"golang.org/x/text/encoding/simplifiedchinese"
c "github.com/qydysky/bili_danmu/CV"
f := file.New(v, int64(rangeHeaderNum), false)
defer f.Close()
- if e := f.CopyToIoWriter(w, 1000000, true); e != nil {
+ // 直播流回放速率
+ var speed, _ = humanize.ParseBytes("1 M")
+ if rc, ok := c.C.K_v.LoadV(`直播流回放速率`).(string); ok {
+ if s, e := humanize.ParseBytes(rc); e != nil {
+ flog.L(`W: `, `直播流回放速率不合法:`, e)
+ } else {
+ speed = s
+ }
+ }
+
+ if e := f.CopyToIoWriter(w, int64(speed), true); e != nil {
flog.L(`E: `, e)
}
} else {
"直播Web可以发送弹幕":true,
"弹幕回放-help": "仅保存当前直播间流为true时才有效",
"弹幕回放": true,
+ "直播流回放速率-help": "速率为每秒速率 例最小值(1 MB)",
+ "直播流回放速率": "1 MB",
"ass-help": "只有保存直播流时才考虑生成ass,ass编码默认GB18030(可选utf-8)",
"生成Ass弹幕": true,
"Ass编码": "GB18030",
require (
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/christopher-dG/go-obs-websocket v0.0.0-20200720193653-c4fed10356a5 // indirect
+ github.com/dustin/go-humanize v1.0.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gofrs/uuid v4.3.0+incompatible // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
+github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY=
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
require (
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/dustin/go-humanize v1.0.1
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/klauspost/compress v1.15.11 // indirect
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
+github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=