Skip to content

Commit

Permalink
to #95
Browse files Browse the repository at this point in the history
  • Loading branch information
chigusa committed Jul 15, 2020
1 parent 293d869 commit a7283cf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/live/bilibili/bilibili.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,16 @@ func (l *Live) GetInfo() (info *live.Info, err error) {
if err != nil {
return nil, err
}
if resp.StatusCode != http.StatusOK {
return nil, live.ErrInternalError
}
body, err = resp.Bytes()
if err != nil {
return nil, err
}
if gjson.GetBytes(body, "code").Int() != 0 {
return nil, live.ErrInternalError
}

info.HostName = gjson.GetBytes(body, "data.info.uname").String()
return info, nil
Expand Down

0 comments on commit a7283cf

Please sign in to comment.