Skip to content

Commit

Permalink
add huya error check (#740)
Browse files Browse the repository at this point in the history
  • Loading branch information
kira1928 authored May 31, 2024
1 parent dbb314b commit 4782745
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/live/huya/huya.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ func (l *Live) GetStreamUrls() (us []*url.URL, err error) {
}

streamInfoJsons := streamJson.Get("data.0.gameStreamInfoList").Array()
if len(streamInfoJsons) == 0 {
return nil, fmt.Errorf("gameStreamInfoList not found")
}
index := l.lastCdnIndex
if index >= len(streamInfoJsons) {
index = 0
Expand Down

0 comments on commit 4782745

Please sign in to comment.