优化虎牙

pull/51/head
肥羊 3 years ago committed by GitHub
parent a3b1a05165
commit 2991ab7ff4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      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")

Loading…
Cancel
Save