From 2991ab7ff477e85f25a6596515e2b43b6536c335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=A5=E7=BE=8A?= Date: Thu, 8 Jun 2023 02:27:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=99=8E=E7=89=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Golang/liveurls/huya.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Golang/liveurls/huya.go b/Golang/liveurls/huya.go index f1ece18..65a6840 100644 --- a/Golang/liveurls/huya.go +++ b/Golang/liveurls/huya.go @@ -11,7 +11,6 @@ import ( "bytes" "crypto/md5" "encoding/base64" - "encoding/hex" "encoding/json" "fmt" "io" @@ -143,12 +142,10 @@ func processAntiCode(antiCode string, uid int, streamName string) string { q.Set("seqid", seqId) q.Set("uid", strconv.Itoa(uid)) q.Set("uuid", strconv.FormatInt(getUUID(), 10)) - ss := md5huya([]byte(seqId + "|" + q.Get("ctype") + "|" + q.Get("t"))) + ss := md5huya(seqId + "|" + q.Get("ctype") + "|" + q.Get("t")) fm, _ := base64.StdEncoding.DecodeString(q.Get("fm")) q.Set("fm", strings.Replace(strings.Replace(strings.Replace(strings.Replace(string(fm), "$0", q.Get("uid"), -1), "$1", streamName, -1), "$2", ss, -1), "$3", q.Get("wsTime"), -1)) - h.Reset() - h.Write([]byte(q.Get("fm"))) - q.Set("wsSecret", hex.EncodeToString(h.Sum(nil))) + q.Set("wsSecret", md5huya(q.Get("fm"))) q.Del("fm") if _, ok := q["txyp"]; ok { q.Del("txyp")