Uid = 0
Protover = 2
Platform = "web"
- VERSION = "2.0.11"
Type = 2
)
\ No newline at end of file
Live string//直播链接
Roomid int
Cookie string
+)
+
+//from player-loader-2.0.11.min.js
+/*
+ customAuthParam
+*/
+var (
+ VERSION = "2.0.11"
)
\ No newline at end of file
} else {
o.Uid = i
}
+ //VERSION
+ if e := r.S(`player-loader-`, `.min`, 0, 0).Err;e == nil {
+ c.VERSION = r.RS
+ }
+ apilog.W("api version", c.VERSION)
//roomid
if tmp := r.S(`"room_id":`, `,`, 0, 0);tmp.Err != nil {
// apilog.E("room_id", tmp.Err)
return
}
}
+ if e := r.S(`player-loader-`, `.min`, 0, 0).Err;e == nil {
+ c.VERSION = r.RS
+ }
+ apilog.W("api version", c.VERSION)
}
{//api获取
req := p.Req()
//Qtd 弹幕Qt窗口
type Qtd struct {
Inuse bool
+ Qt_MaxMun int
+ Qt_LineHeight float64
+ Qt_BlockMargin float64
+ Qt_FontSize int
+ Qt_FontWeight int
+ Qt_Background []int
}
var qtd = Qtd {
Inuse:IsOn("Qtd"),
+ Qt_MaxMun:30,//danmu max limit
+ Qt_LineHeight:90,//percent
+ Qt_BlockMargin:7,
+ Qt_FontSize:16,//pixel
+ Qt_FontWeight:57,
+ /*
+ QFont__Thin QFont__Weight = QFont__Weight(0)
+ QFont__ExtraLight QFont__Weight = QFont__Weight(12)
+ QFont__Light QFont__Weight = QFont__Weight(25)
+ QFont__Normal QFont__Weight = QFont__Weight(50)
+ QFont__Medium QFont__Weight = QFont__Weight(57)
+ QFont__DemiBold QFont__Weight = QFont__Weight(63)
+ QFont__Bold QFont__Weight = QFont__Weight(75)
+ QFont__ExtraBold QFont__Weight = QFont__Weight(81)
+ QFont__Black QFont__Weight = QFont__Weight(87)
+ */
+ Qt_Background:[]int{0, 0, 0, 140},//rgba
}
func Qtdf(){
if p.Checkfile().IsExist(saveflv.path+".flv"){
l.I("转码中")
p.Exec().Run(false, "ffmpeg", "-i", saveflv.path+".flv", "-c", "copy", saveflv.path+".mkv")
- os.Remove(saveflv.path+".flv")
+ // os.Remove(saveflv.path+".flv")
}
l.I("转码结束")
saveflv.wait.Done()
saveflv.cancel.Done()
}
+ saveflv.wait.Done()
+ saveflv.cancel.Done()
}
//已func形式调用,将会停止保存直播流
}
fmt.Println("\n====")
fmt.Println(sh...)
+ Qtshow("\n====")
+ Qtshow(Itos(sh))
if message != nil && message.(string) != ""{
fmt.Println(message)
+ Qtshow(message.(string))
sh = append(sh, message)
}
if message_jpn != nil && message.(string) != message_jpn.(string) && message_jpn.(string) != "" {
fmt.Println(message_jpn)
+ Qtshow(message_jpn.(string))
sh = append(sh, message_jpn)
}
fmt.Print("====\n\n")
{//额外
Assf(fmt.Sprintln(sh...))
- Qtshow("\n====")
- Qtshow(Itos(sh))
Qtshow("====\n")
}
msglog.Base(1, "礼").Fileonly(true).I(sh...).Fileonly(false)
case float64: r+= strconv.Itoa(int(v.(float64)))
default:fmt.Println("unkonw type", v)
}
+ i += " "
}
return r
}
\ No newline at end of file
import (
"os"
+ c "github.com/qydysky/bili_danmu/CV"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/widgets"
Qt_MaxMun int = 30//danmu max limit
Qt_LineHeight float64 = 90//percent
Qt_BlockMargin float64 = 7
+ Qt_FontSize int = 18
+ Qt_FontWeight int = 63
+ Qt_Background []int = []int{0, 0, 0, 140}//rgba
)
func Qtdanmu() {
+ if QtOn {return}
+ Qt_MaxMun = qtd.Qt_MaxMun
+ Qt_LineHeight = qtd.Qt_LineHeight
+ Qt_BlockMargin = qtd.Qt_BlockMargin
+ Qt_FontSize = qtd.Qt_FontSize
+ Qt_FontWeight = qtd.Qt_FontWeight
+ Qt_Background = qtd.Qt_Background
+
widgets.NewQApplication(len(os.Args), os.Args)
//主窗口
QtDanmuChan = make(chan string, 10)
QtOn = true
// var list []string
- t.TextCursor().InsertText("==开始==")
+ t.TextCursor().InsertText("房间:", strconv.Itoa(c.Roomid))
for QtOn {
select{
case i :=<-QtDanmuChan:
t = widgets.NewQTextEdit(pare)
{
Qp := gui.NewQPalette()
- Qp.SetColor2(gui.QPalette__Base, gui.NewQColor3(0, 0, 0, 140));
+ q := Qt_Background
+ Qp.SetColor2(gui.QPalette__Base, gui.NewQColor3(q[0], q[1], q[2], q[3]));
t.SetPalette(Qp)
}
t.SetVerticalScrollBarPolicy(core.Qt__ScrollBarAlwaysOff)
// t.SetMaximumBlockCount(100)
t.SetContentsMargins(0, 0, 0, 0)
// t.SetCenterOnScroll(false)
+ // t.SetTextInteractionFlags(core.Qt__TextEditable)
t.SetReadOnly(true)
{
t.SetTextBackgroundColor(gui.NewQColor3(0, 0, 0, 0))
f := gui.NewQFont()
- f.SetPixelSize(18)
- f.SetWeight(63)
+ f.SetPixelSize(Qt_FontSize)
+ f.SetWeight(Qt_FontWeight)
t.SetCurrentFont(f)
}
{
func text(s string, pare *widgets.QTextEdit) {
c := pare.TextCursor()
+ c.MovePosition(gui.QTextCursor__End, gui.QTextCursor__MoveAnchor, 1)
c.InsertBlock()
c.BeginEditBlock()
c.InsertText(s)
c.MovePosition(gui.QTextCursor__End, gui.QTextCursor__MoveAnchor, 1)
}
// t := pare.ToPlainText()
+ pare.SetTextCursor(c)
pare.EnsureCursorVisible()
// pare.SetPlainText(s + "\n" + t)