Rev float64//营收
Renqi int//人气
GuardNum int//舰长数
+ Note string//分区排行
Live_Start_Time time.Time//直播开始时间
Liveing bool//是否在直播
)
Roomid := strconv.Itoa(o.Roomid)
r := g.Get(p.Rval{
- Url:"https://live.bilibili.com/" + Roomid,
+ Url:"https://live.bilibili.com/blanc/" + Roomid,
})
//uid
if tmp := r.S(`"uid":`, `,`, 0, 0);tmp.Err != nil {
if e := r.S(`"title":"`, `",`, 0, 0).Err;e == nil {
c.Title = r.RS[0]
}
+ //排行
+ if e := r.S(`"rank_desc":"`, `",`, 0, 0).Err;e == nil {
+ c.Note = r.RS[0]
+ }
//roomid
if tmp := r.S(`"room_id":`, `,`, 0, 0);tmp.Err != nil {
// apilog.E("room_id", tmp.Err)
apilog.E("code", code, p.Json().GetValFrom(res, "message"))
return
}
+ //排行
+ if rank_desc,ok := p.Json().GetValFrom(res, "data.rankdb_info.rank_desc").(string);ok {
+ c.Note = rank_desc
+ }
if Uid := p.Json().GetValFrom(res, "data.room_info.uid");Uid == nil {
apilog.E("data.room_info.uid", Uid)
return
if len(qn) == 0 || qn[0] == "0" || qn[0] == "" {//html获取
r := g.Get(p.Rval{
- Url:"https://live.bilibili.com/" + strconv.Itoa(o.Roomid),
+ Url:"https://live.bilibili.com/blanc/" + strconv.Itoa(o.Roomid),
Header:map[string]string{
`Cookie`:Cookie,
},
./demo.run -q 清晰度 -r 房间ID
```
-> 清晰度可取[数值](https://github.com/qydysky/bili_danmu/blob/028d6d8ed47df4631aca7df93871a4795bedda76/CV/Var.go#L19)
+> 清晰度可取[数值](https://github.com/qydysky/bili_danmu/blob/cf52498a88e885fb66dbc94fb8652cb6fa35fb26/CV/Var.go#L37)
> 弹幕及礼物会记录于danmu.log中
**部分功能需要在`demo`目录(文件夹)下放置`cookie.txt`才可用**
}
autoskip.num -= 1
i, ok := autoskip.buf.LoadAndDelete(s);
- if ok && i.(int) > 1 {Msg_showdanmu(nil, strconv.Itoa(i.(int)) + " x " + s,`0multi`)}//多人重复提示
+ if ok {//多人重复提示
+ switch i.(int) {
+ case 0,1:
+ case 2,3:Msg_showdanmu(nil, strconv.Itoa(i.(int)) + " x " + s,`0default`)
+ default:Msg_showdanmu(nil, strconv.Itoa(i.(int)) + " x " + s,`0multi`)
+ }
+ }
}()
return 0
}
Class:`tts`,
Data:Danmu_mq_t{
uid:`0follow`,
- msg:fmt.Sprintln(v + `关注了直播间`),
+ msg:fmt.Sprint(v + `关注了直播间`),
},
})
}
c.Danmu_Main_mq.Push(c.Danmu_Main_mq_item{
Class:`tts`,
Data:Danmu_mq_t{
- uid:`0guard_update`,
- msg:fmt.Sprintln(sh...),
+ uid:`0buyguide`,
+ msg:fmt.Sprint(sh...),
},
})
}
msglog.E("note", note)
return
} else {
+ if v,ok := note.(string);ok{c.Note = v}
fmt.Println("排行", note)
msglog.I("排行", note)
}
var w2_textView1 *gtk.TextView
var w2_textView2 *gtk.TextView
var w2_textView3 *gtk.TextView
+ var w2_textView4 *gtk.TextView
var renqi_old = 1
var w2_Entry0 *gtk.Entry
var w2_Entry0_editting bool
w2_textView3 = tmp
}else{log.Println("cant find #t3 in .glade");return}
}
+ {//排名
+ obj, err := builder2.GetObject("t4")
+ if err != nil {log.Println(err);return}
+ if tmp,ok := obj.(*gtk.TextView); ok {
+ w2_textView4 = tmp
+ }else{log.Println("cant find #t4 in .glade");return}
+ }
{//发送弹幕
var danmu_send_form string
{//发送弹幕格式
y(`输入错误`,load_face("0room"))
} else {
c.Roomid = i
- renqi_old = 1//人气置1
c.Danmu_Main_mq.Push(c.Danmu_Main_mq_item{
Class:`change_room`,
})
return
}
+ loc := int(grid0.Container.GetChildren().Length())/2;
step := 0.1 * (max - cu)
if step > 0.5 {
- if step > 10 {step = 10}//限制最大滚动速度
+ if step > 5 {step = 5}//限制最大滚动速度
+ if loc > max_danmu {step += float64(loc - max_danmu) / 10}
tmp.SetValue(step + cu)
} else {
in_smooth_roll = false
tmp.SetValue(max)
- loc := int(grid0.Container.GetChildren().Length())/2;
for loc > max_danmu {
if i,e := grid0.GetChildAt(0,0); e != nil{i.(*gtk.Widget).Destroy()}
if i,e := grid0.GetChildAt(1,0); e != nil{i.(*gtk.Widget).Destroy()}
if e != nil {log.Println(e);return}
b.SetText(fmt.Sprintf("%d",c.GuardNum))
}
+ {//分区排行
+ b,e := w2_textView4.GetBuffer()
+ if e != nil {log.Println(e);return}
+ b.SetText(c.Note)
+ }
{//时长
b,e := w2_textView1.GetBuffer()
if e != nil {log.Println(e);return}
package reply
import (
- "log"
+ "fmt"
"net/url"
"strings"
p "github.com/qydysky/part"
func TTS(uid,msg string) {
if tts_limit.TO() {return}
- log.Println(`TTS:`, uid, msg)
+ fmt.Println(`TTS:`, uid, msg)
req := p.Req()
if v,ok := tts_setting[uid];ok{
msg = strings.ReplaceAll(v, "{D}", msg)
Retry:1,
SleepTime:500,
});err != nil {
- log.Println(`TTS:`, err)
+ fmt.Println(`TTS:`, err)
return
}
p.Exec().Run(false, "ffplay", p.Sys().Cdir()+"/tts.mp3","-autoexit","-nodisp")
case `change_room`:
c.Rev = 0.0 //营收
c.Renqi = 1//人气置1
+ c.GuardNum = 0//舰长数
+ c.Note = ``//分区排行
c.Title = ``
reply.Saveflv_wait()//停止保存直播流
change_room_chan <- true
"0buyguide":"感谢{D}",
"0gift":"感谢{D}",
"0superchat":"感谢{D}",
- "0multi":"观众:{D}",
- "0follow":"感谢{D}"
+ "0multi":"观众:{D}"
}
\ No newline at end of file
<property name="top_attach">4</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">排行榜</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTextView" id="t4">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</property>
+ <property name="justification">right</property>
+ <property name="cursor_visible">False</property>
+ <property name="accepts_tab">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">5</property>
+ </packing>
+ </child>
<style>
<class name="this_time_body"/>
</style>