fix time error

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

@ -98,14 +98,17 @@ func getUUID() int64 {
}
func processAntiCode(antiCode string, uid int, streamName string) string {
location, _ := time.LoadLocation("Asia/Shanghai")
now := time.Now().In(location)
TimeLocation, err := time.LoadLocation("Asia/Shanghai")
if err != nil {
TimeLocation = time.FixedZone("CST", 8*60*60)
}
now := time.Now().In(TimeLocation)
q, _ := url.ParseQuery(antiCode)
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", now.Format("2006010203"))
q.Set("sv", now.Format("2006010215"))
seqId := strconv.Itoa(uid + int(time.Now().UnixNano()/int64(time.Millisecond)))
q.Set("seqid", seqId)
q.Set("uid", strconv.Itoa(uid))

Loading…
Cancel
Save