From 9afebbe85cf86dafdc063e32c2cf29c38f91d0d1 Mon Sep 17 00:00:00 2001 From: kira1928 Date: Sat, 1 Jun 2024 01:32:46 +0900 Subject: [PATCH] add huya error check --- src/live/huya/huya.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/live/huya/huya.go b/src/live/huya/huya.go index 083be82b..3b13028f 100644 --- a/src/live/huya/huya.go +++ b/src/live/huya/huya.go @@ -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