Skip to content

Commit e9d9d5b

Browse files
committed
unknown bug
1 parent c22d671 commit e9d9d5b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

relay.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ const EventEmitter = require('events')
33
const { KeepLiveWS } = require('bilibili-live-ws')
44

55
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())
6+
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)]
78
const address = `wss://${host}/sub`
89
return { key, host, address }
910
}

0 commit comments

Comments
 (0)