diff --git a/Golang/liveurls/huya.go b/Golang/liveurls/huya.go index 3a6d8fe..6b96336 100644 --- a/Golang/liveurls/huya.go +++ b/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))