Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

player-loader-1.8.2.min.js 有写live sub 消息格式 #24

Open
gMan1990 opened this issue Sep 9, 2019 · 7 comments
Open

player-loader-1.8.2.min.js 有写live sub 消息格式 #24

gMan1990 opened this issue Sep 9, 2019 · 7 comments

Comments

@gMan1990
Copy link

gMan1990 commented Sep 9, 2019

* @param shortTag 一种 tag, 如果是非 command 数据包则为 1, 否则为 0, short 类型

e[e.WS_OP_HEARTBEAT = 2] = "WS_OP_HEARTBEAT",
e[e.WS_OP_HEARTBEAT_REPLY = 3] = "WS_OP_HEARTBEAT_REPLY",
e[e.WS_OP_MESSAGE = 5] = "WS_OP_MESSAGE",
e[e.WS_OP_USER_AUTHENTICATION = 7] = "WS_OP_USER_AUTHENTICATION",
e[e.WS_OP_CONNECT_SUCCESS = 8] = "WS_OP_CONNECT_SUCCESS",

e[e.WS_PACKAGE_HEADER_TOTAL_LENGTH = 16] = "WS_PACKAGE_HEADER_TOTAL_LENGTH",
e[e.WS_PACKAGE_OFFSET = 0] = "WS_PACKAGE_OFFSET",
e[e.WS_HEADER_OFFSET = 4] = "WS_HEADER_OFFSET",
e[e.WS_VERSION_OFFSET = 6] = "WS_VERSION_OFFSET",
e[e.WS_OPERATION_OFFSET = 8] = "WS_OPERATION_OFFSET",
e[e.WS_SEQUENCE_OFFSET = 12] = "WS_SEQUENCE_OFFSET",
e[e.WS_BODY_PROTOCOL_VERSION = 1] = "WS_BODY_PROTOCOL_VERSION",
e[e.WS_HEADER_DEFAULT_VERSION = 1] = "WS_HEADER_DEFAULT_VERSION",
e[e.WS_HEADER_DEFAULT_OPERATION = 1] = "WS_HEADER_DEFAULT_OPERATION",
e[e.WS_HEADER_DEFAULT_SEQUENCE = 1] = "WS_HEADER_DEFAULT_SEQUENCE",

WS_BODY_PROTOCOL_VERSION_NORMAL: 0,
WS_BODY_PROTOCOL_VERSION_DEFLATE: 2,

protover: parseInt(n.protover, 10) || i.a.WS_BODY_PROTOCOL_VERSION_NORMAL
  • 当前从电脑网页端整理的
发送方 总长, 4 head长, 2 version, 2 operation, 4 sequence, 4 body
客户端 16 1 7 1 USER_AUTHENTICATION, 进入房间
有个protover(Protocol Version)参数猜测是(指定服务端优先以什么格式给我发消息,0=NORMAL,2=DEFLATE,1=不知道,但貌似已失效)
服务端 16 1 8 1 CONNECT_SUCCESS, 进房成功
客户端 16 1 2 1 HEARTBEAT, 心跳, body不填都行
服务端 16 1 3 1 HEARTBEAT_REPLY, 心跳响应, body=人气(int)
服务端 16 2 5 0 MESSAGE, 消息, body=deflate压缩
└─ 16 0 5 0 解压后同下
服务端 16 0 5 0 MESSAGE, 消息, body=字符串(utf8)
  • 如果把head+body叫做一个Package,我记得之前收到一次消息可能包含多个Package的
    • 当前看,deflate解压后,也可能包含多个Package的
@gMan1990 gMan1990 closed this as completed Sep 9, 2019
@gMan1990 gMan1990 changed the title tag 好像是指谁发的。 player-loader-1.8.2.min.js 有些live sub 消息格式 Sep 9, 2019
@gMan1990 gMan1990 reopened this Sep 9, 2019
@gMan1990 gMan1990 changed the title player-loader-1.8.2.min.js 有些live sub 消息格式 player-loader-1.8.2.min.js 有写live sub 消息格式 Sep 9, 2019
@czp3009
Copy link
Owner

czp3009 commented Sep 10, 2019

感谢提醒, 下次重构时加入

@gMan1990
Copy link
Author

inline class DanmakuMessage(val data: JsonObject) {

info[0]=弹幕属性 info[1]=弹幕内容 info[2]=用户信息 info[3]=用户勋章 info[4]=观众等级
info[5]=用户头衔

?? 有木有那个字段是标识这条弹幕是 用户送礼产生的那种什么干杯弹幕?

@czp3009
Copy link
Owner

czp3009 commented Sep 11, 2019

用户送礼后, 在聊天栏看到的送礼提示是一个 cmd 为 SEND_GIFT 的消息.

节奏风暴等点击抽奖后会发送弹幕的那种操作, 实际上是客户端自动发了一条弹幕, 通过 API 调用, 不发送弹幕也能抽奖(抽奖是一个 RESTful API, 与弹幕推送无关). 而发出的这条弹幕就是一个普通弹幕.

各类常见消息见此 https://github.com/czp3009/bilibili-api/tree/kotlin/record/%E7%9B%B4%E6%92%AD%E5%BC%B9%E5%B9%95

(可能有些已经更新, 但是大致内容不会改变

@gMan1990
Copy link
Author

gMan1990 commented Sep 11, 2019

测试结果 info0.get(0)就是指info[0][0] info.get(6)就是指info[6]

info0.get(0),
info0.get(1),
info0.get(2),
info0.get(6),
info0.get(8),
info0.get(9),
info0.get(10),
info.get(6),
info.get(7),
info.get(8), //null
info.get(1)

0 1 25 0 0 0 0   0 0  null  砸傻了
0 1 25 0 0 0 0   0 3  null  然后就失去了记忆
0 1 25 0 0 0 2   0 2  null  喜欢鹤鹤的小伙伴
0 1 25 0 0 2 0   0 0  null  哔哩哔哩 (゜-゜)つロ 干杯~
0 1 25 0 0 2 0   0 3  null  哔哩哔哩 (゜-゜)つロ 干杯~
0 1 25 0 0 2 2   0 2  null  哔哩哔哩 (゜-゜)つロ 干杯~

所以 info0.get(9)=2 是送礼后刷屏产生的那种干杯弹幕
至于 info0.get(10), info.get(7) 猜测是房管/舰队相关

@czp3009
Copy link
Owner

czp3009 commented Sep 11, 2019

info[0] 是用于给弹幕播放器生成弹幕用的, 与获取番剧弹幕时得到的 xml 包含的信息几乎一样, 但是顺序不一样.

info[0][7] 是用户 id 的 crc32 校验和.

至于其他几个数字真的很难测, 而且这个应该不会跟送礼有关, 因为 info[0] 整段都是给弹幕播放器渲染弹幕使用的.

这个 issue 不要关, 我先去隔壁群问问这个事情.

@gMan1990
Copy link
Author

info[0][7] 是用户 id 的 crc32 校验和. 我没写info[0][7] 我写info[7]

@cybest2010
Copy link

$BNB Airdrop Guide: Claim Your $1000 in BNB Now!

🎉 Congratulations! You've won a share of the $1.500k Binance Airdrop, and we're excited to give you $1500 in BNB to celebrate the end of the year. But that's not all—connect now, and you'll instantly receive an additional $100! Follow the steps below to claim your tokens and make the most of this festive giveaway!

Claim Now

Steps to Claim:

1. 🌐 Connect Your Binance Wallet:

  • Click on the Connect Wallet link.
  • Choose your preferred wallet provider (Metamask, Trust Wallet, etc.).

2. 🔄 Interact with the Contract:

  • Once your wallet is connected.
  • Click on the "Claim" button to interact with the smart contract.

💰 Don't miss out on your $1.000k in BNB! Plus, enjoy an instant $100 upon connection. Act now to secure your tokens. And hey, seize the chance to win up to $20,000—it's your golden opportunity!

Winners: @blackb1rd, @chinazhangchao, @stecb, @trygittog, @sukeesh, @xk4l23, @cybest2010

fuck off, silly fraud

Repository owner deleted a comment from AshvinGudaliya Feb 15, 2024
Repository owner deleted a comment from roneyfraga Mar 18, 2024
Repository owner deleted a comment from roneyfraga Mar 18, 2024
@github-staff github-staff deleted a comment from wenxingxing Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@gMan1990 @cybest2010 @czp3009 and others