- name: Set up Go
uses: actions/setup-go@v2
with:
- go-version: ^1.15.3
+ go-version: ^1.15.4
id: go
- name: Check out code
- name: Set up Go
uses: actions/setup-go@v2
with:
- go-version: ^1.15.3
+ go-version: ^1.15.4
id: go
- name: Set up C
- name: Set up Go
uses: actions/setup-go@v2
with:
- go-version: ^1.15.3
+ go-version: ^1.15.4
id: go
- name: Check out code
- name: Set up Go
uses: actions/setup-go@v2
with:
- go-version: ^1.15.3
+ go-version: ^1.15.4
id: go
- name: Set up C
}
{//重试
+ l.I("尝试连接live")
if e := rr.Reqf(p.Rval{
Url:c.Live[cuLinkIndex],
Retry:10,
SleepTime:5,
Cookie:Cookie,
- Timeout:-1,
+ Timeout:5,
JustResponseCode:true,
}); e != nil{l.W(e)}
}
//Msg-超级留言处理
+var sc_buf = make(map[string]bool)
func (replyF) super_chat_message(s string){
+ id := p.Json().GetValFromS(s, "data.id");
+ if id != nil {
+ if _,ok := sc_buf[id.(string)];ok{return}
+ if len(sc_buf) >= 10 {
+ for k,_ := range sc_buf {delete(sc_buf, k);break}
+ }
+ sc_buf[id.(string)] = true
+ }
uname := p.Json().GetValFromS(s, "data.user_info.uname");
price := p.Json().GetValFromS(s, "data.price");
message := p.Json().GetValFromS(s, "data.message");
p "github.com/qydysky/part"
F "github.com/qydysky/bili_danmu/F"
)
-const max = 50
+const (
+ max = 50
+ max_keep = 5
+ max_img = 500
+)
+
const appId = "com.github.qydysky.bili_danmu.reply"
type gtk_list struct {
"face/0jiezou":8,
"face/0level1":5,
"face/0level2":3,
- "face/0level3":2,
+ "face/0level3":1,
"face/0superchat":13,
}
var (
func Gtk_danmu() {
if Gtk_on {return}
+ gtk.Init(nil)
var y func(string,string)
var win *gtk.Window
var scrolledwindow0 *gtk.ScrolledWindow
var viewport0 *gtk.Viewport
-
+
application, err := gtk.ApplicationNew(appId, glib.APPLICATION_FLAGS_NONE)
if err != nil {log.Println(err);return}
back index:0
*/
var InsertIndex int = keep_list.Len()
- if sec != 0 {
+ if sec > InsertIndex / max_keep {
var cu_To = time.Now().Add(time.Second * time.Duration(sec))
var hasInsert bool
for el := keep_list.Front(); el != nil; el = el.Next(){
}
{
- if len(imgbuf) > 1000 {
+ if len(imgbuf) > max_img {
for k,_ := range imgbuf {delete(imgbuf,k);break}
}
}
go func(){
for{
time.Sleep(time.Second)
+ if len(Gtk_danmuChan) == 0 {continue}
for el := keep_list.Front(); el != nil && time.Now().After(el.Value.(time.Time));el = el.Next() {
keep_list.Remove(el)
}
- if len(Gtk_danmuChan) == 0 {continue}
glib.TimeoutAdd(uint(1000 / (len(Gtk_danmuChan) + 1)),func()(bool){
if len(Gtk_danmuChan) == 0 {return false}
y(<-Gtk_danmuChan,load_face(<-Gtk_danmuChan_uid))
-202010231620
\ No newline at end of file
+202011110547
\ No newline at end of file
{
"Gtk": true,
"Qtd": false,
- "Saveflv": false,
+ "Saveflv": true,
"Ass": true,
"Obs": false,
"Autoban": false,
require (
github.com/christopher-dG/go-obs-websocket v0.0.0-20200720193653-c4fed10356a5 // indirect
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
- github.com/gotk3/gotk3 v0.5.0 // indirect
+ github.com/gotk3/gotk3 v0.5.1-0.20201028052159-952547abf55a // indirect
github.com/klauspost/compress v1.11.1 // indirect
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/qydysky/bili_danmu v0.0.0
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gotk3/gotk3 v0.5.0 h1:GOkq4cFgAfeK6YAukLi64bz8zPayZKeCSSRr4mcFReQ=
github.com/gotk3/gotk3 v0.5.0/go.mod h1:/hqFpkNa9T3JgNAE2fLvCdov7c5bw//FHNZrZ3Uv9/Q=
+github.com/gotk3/gotk3 v0.5.1-0.20201028052159-952547abf55a h1:9O8VeGmNRqh8UPYLfjYc+W3Gu7vSVTo2uEswq4FO9xI=
+github.com/gotk3/gotk3 v0.5.1-0.20201028052159-952547abf55a/go.mod h1:/hqFpkNa9T3JgNAE2fLvCdov7c5bw//FHNZrZ3Uv9/Q=
github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.0 h1:wJbzvpYMVGG9iTI9VxpnNZfd4DzMPoCWze3GgSqz8yg=
github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=