]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
优化小心心web加密
authorqydysky <qydysky@foxmail.com>
Sat, 12 Jun 2021 09:10:47 +0000 (17:10 +0800)
committerqydysky <qydysky@foxmail.com>
Sat, 12 Jun 2021 09:10:47 +0000 (17:10 +0800)
F/xinxin.go

index b4aa1972405d09595cdbfe3425e5508996c2e3be..30aeac68ccf856e83e5701ecd4f61e3f2bd4bb3a 100644 (file)
@@ -5,6 +5,7 @@ import (
        "strconv"
        "encoding/json"
     "time"
+       "strings"
 
        c "github.com/qydysky/bili_danmu/CV"
 
@@ -173,15 +174,10 @@ func Wasm(uid uintptr,s RT) (o string) {//maxloop 超时重试
        }
 
        {//web
-               b, e := json.Marshal(s)
-               if e != nil {
-                       wslog.L(`E: `,e)
-               }
-
                for try:=5;try > 0 && ws.Len() == 0;try-=1 {//没有从池中取出
                        open.Run(webpath)
                        wslog.L(`I: `,`浏览器打开`,webpath)
-                       time.Sleep(time.Second*time.Duration(3))
+                       time.Sleep(time.Second*time.Duration(10))
                }
 
                if ws.Len() == 0 {
@@ -189,6 +185,14 @@ func Wasm(uid uintptr,s RT) (o string) {//maxloop 超时重试
                        return
                }
 
+               if !strings.Contains(s.R.Ua, `Test`) {
+                       s.R.Ts = int(p.Sys().GetMTime())
+               }
+               b, e := json.Marshal(s)
+               if e != nil {
+                       wslog.L(`E: `,e)
+               }
+
                //获取websocket操作对象 发送
                ws.Interface().Push_tag(`send`,websocket.Uinterface{
                        Id:uid,
@@ -230,7 +234,7 @@ func test(uid uintptr) bool {
                Benchmark: "seacasdgyijfhofiuxoannn",
                Time: 60,
                Ts: 1611836642190,
-               Ua:`Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0`,
+               Ua:`Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0 Test`,
                },
                T: []int{2, 5, 1, 4},
        });s != `e4249b7657c2d4a44955548eb814797d41ddd99bfdfa5974462b8c387d701b8c83898f6d7dde1772c67fad6a113d20c20e454be1d1627e7ea99617a8a1f99bd0` {