pull/70/head
肥羊 2 years ago committed by GitHub
parent edddbf1c4e
commit 1d23bc4cee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 13
      Golang/liveurls/huya.go

@ -98,12 +98,14 @@ func getUUID() int64 {
}
func processAntiCode(antiCode string, uid int, streamName string) string {
location, _ := time.LoadLocation("Asia/Shanghai")
now := time.Now().In(location)
q, _ := url.ParseQuery(antiCode)
q.Set("t", "100")
q.Set("ctype", "huya_live")
q.Set("t", "102")
q.Set("ctype", "tars_mp")
q.Set("wsTime", strconv.FormatInt(time.Now().Unix()+21600, 16))
q.Set("ver", "1")
q.Set("sv", "2110211124")
q.Set("sv", now.Format("2006010203"))
seqId := strconv.Itoa(uid + int(time.Now().UnixNano()/int64(time.Millisecond)))
q.Set("seqid", seqId)
q.Set("uid", strconv.Itoa(uid))
@ -167,7 +169,7 @@ func (h *Huya) GetLiveUrl() any {
for k, v := range urlarr {
switch k {
case h.Cdn:
mediaurl = v
mediaurl = strings.Replace(v, "http://", "https://", 1)
}
}
}
@ -178,7 +180,7 @@ func (h *Huya) GetLiveUrl() any {
if roomProfile, ok := liveArr["roomProfile"].(map[string]any); ok {
if liveLineUrl, ok := roomProfile["liveLineUrl"].(string); ok {
decodedLiveLineUrl, _ := base64.StdEncoding.DecodeString(liveLineUrl)
mediaurl = "http:" + string(decodedLiveLineUrl)
mediaurl = "https:" + string(decodedLiveLineUrl)
}
}
} else {
@ -186,5 +188,4 @@ func (h *Huya) GetLiveUrl() any {
}
}
return mediaurl
}

Loading…
Cancel
Save