summaryrefslogtreecommitdiff
path: root/bilibili/danmaku_server_info.go
diff options
context:
space:
mode:
authorKeuin <[email protected]>2023-07-29 20:28:19 +0800
committerKeuin <[email protected]>2023-07-29 20:28:28 +0800
commitc4dbd4a7b2ad86fcb0220a4e2ffdae68d0d00103 (patch)
tree37e3487153a377aa5555d780c15f3a774237722e /bilibili/danmaku_server_info.go
parent9b5c3913989754370bd7d03ac8cf2e32a6172afb (diff)
Merge branch 'bugfix-invalid-dmmsg'v0.5.0
Diffstat (limited to 'bilibili/danmaku_server_info.go')
-rw-r--r--bilibili/danmaku_server_info.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/bilibili/danmaku_server_info.go b/bilibili/danmaku_server_info.go
index 8c79d51..119a8f9 100644
--- a/bilibili/danmaku_server_info.go
+++ b/bilibili/danmaku_server_info.go
@@ -7,8 +7,6 @@ import (
"net/url"
)
-type WebBannerResponse = BaseResponse[interface{}]
-
const apiUrlPrefix = "https://api.live.bilibili.com"
func (b *Bilibili) GetDanmakuServerInfo(roomId types.RoomId) (resp types.DanmakuServerInfoResponse, err error) {
@@ -38,10 +36,10 @@ func (b *Bilibili) GetBUVID() (string, error) {
}
// GetLiveBUVID initializes cookie `LIVE_BUVID`. This should be called before GetDanmakuServerInfo.
-func (b *Bilibili) GetLiveBUVID(roomId types.RoomId) (resp WebBannerResponse, err error) {
+func (b *Bilibili) GetLiveBUVID(roomId types.RoomId) (resp types.WebBannerResponse, err error) {
u := fmt.Sprintf("https://api.live.bilibili.com/activity/v1/Common/webBanner?"+
"platform=web&position=6&roomid=%d&area_v2_parent_id=0&area_v2_id=0&from=", roomId)
- resp, err = callGet[WebBannerResponse](b, u)
+ resp, err = callGet[types.WebBannerResponse](b, u)
if err == nil {
uu, _ := url.Parse(apiUrlPrefix)
b.logger.Info("Cookie info: %v", b.http.Jar.Cookies(uu))