From 8d5d93d7175b22476bdb41313d7e54559e0f67a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=A5=E7=BE=8A?= Date: Fri, 5 Jan 2024 05:45:20 +0800 Subject: [PATCH] fix huya --- Golang/liveurls/huya.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Golang/liveurls/huya.go b/Golang/liveurls/huya.go index ef01984..2202367 100644 --- a/Golang/liveurls/huya.go +++ b/Golang/liveurls/huya.go @@ -84,6 +84,9 @@ func (h *Huya) GetLiveUrl() any { } liveInfoJson := gjson.Parse(liveInfoJsonRawString) streamInfoJsons := liveInfoJson.Get("tLiveStreamInfo.vStreamInfo.value") + if len(streamInfoJsons.Array()) == 0 { + return nil + } var cdnSlice []string var finalurl string streamInfoJsons.ForEach(func(key, value gjson.Result) bool {