fix zero length hostlist

This commit is contained in:
aynakeya
2025-04-24 23:16:42 +08:00
parent 286c36c4dd
commit 66dbc68632
3 changed files with 5 additions and 1 deletions

View File

@@ -74,6 +74,7 @@ func GetDanmuInfo(roomID int, cookie string) (*DanmuInfo, error) {
result := &DanmuInfo{}
headers := &http.Header{}
headers.Set("cookie", cookie)
headers.Set("user-agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36")
err := GetJsonWithHeader(fmt.Sprintf("https://api.live.bilibili.com/xlive/web-room/v1/index/getDanmuInfo?id=%d&type=0", roomID), headers, result)
if err != nil {
return nil, err