Skip to content
This repository has been archived by the owner on Aug 25, 2019. It is now read-only.

hr3lxphr6j/PandaTvDanmakuClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

PandaTvDanmakuClient

熊猫TV WebSocket 协议弹幕客户端

依赖

使用

from PandaTvDanmakuClient import PandaTvDanmakuClient

panda = PandaTvDanmakuClient()
queue = panda.subscribe(10300)
panda.run()
try:
    while 1:
        data = queue.get()
        print(data)
except KeyboardInterrupt:
    pass
finally:
        panda.close()

输出

队列为无界队列,包含字典对象,包含弹幕和礼物等信息,需要什么字段自己拿就好了

{ 
    "type" : "1", 
    "time" : 1506650124, 
    "data" : {
        "from" : {
            "identity" : "30", 
            "nickName" : "打他吗呢香蕉牛奶", 
            "badge" : "", 
            "rid" : "40998904", 
            "msgcolor" : "", 
            "level" : "7", 
            "sp_identity" : "30", 
            "__plat" : "android", 
            "userName" : ""
        }, 
        "to" : {
            "toroom" : "404055"
        }, 
        "content" : "mini变强了"
    }
}

About

熊猫TV WebSocket协议弹幕客户端

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages