We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c22d671 commit e9d9d5bCopy full SHA for e9d9d5b
relay.js
@@ -3,7 +3,8 @@ const EventEmitter = require('events')
3
const { KeepLiveWS } = require('bilibili-live-ws')
4
5
const getConfW = async roomid => {
6
- const { token: key, host_list: [{ host }] } = await fetch(`https://api.live.bilibili.com/xlive/web-room/v1/index/getDanmuInfo?id=${roomid}`).then(w => w.json())
+ const { data: { token: key, host_list: hosts } } = await fetch(`https://api.live.bilibili.com/xlive/web-room/v1/index/getDanmuInfo?id=${roomid}`).then(w => w.json())
7
+ const { host } = hosts[Math.floor(Math.random() * hosts.length)]
8
const address = `wss://${host}/sub`
9
return { key, host, address }
10
}
0 commit comments