Commit 847aec98 authored by 王明明's avatar 王明明

nk 转换测试

0317 17:56
parent 23c968c7
......@@ -161,24 +161,24 @@ type AkmEvent struct {
}
func (akm *AkmEvent) ActivateRandomEvent() {
if rand.Float64() > 0.4 {
if rand.Float64() > 0.1 {
for i := 0; i < int(math.Floor(rand.Float64()*10+rand.Float64()*10)); i++ {
akm.ActivateKeyEvent("a")
}
}
if rand.Float64() > 0.4 {
if rand.Float64() > 0.2 {
for i := 0; i < int(math.Floor(rand.Float64()*5+rand.Float64()*10)); i++ {
akm.ActivateDeviceMotionEvent()
}
}
if rand.Float64() > 0.4 {
if rand.Float64() > 0.1 {
for i := 0; i < int(math.Floor(rand.Float64()*5+rand.Float64()*10)); i++ {
akm.ActivateOrientationEvent()
}
}
if rand.Float64() > 0.4 {
if rand.Float64() > 0.1 {
for i := 0; i < int(math.Floor(rand.Float64()*5+rand.Float64()*10)); i++ {
akm.ActivatePointerEvent()
......
......@@ -10,7 +10,6 @@ import (
"net/url"
"strings"
"sync"
sensor2 "test/sensor"
)
func getCookie(client tls_client.HttpClient) (string, string) {
......@@ -29,16 +28,17 @@ func getCookie(client tls_client.HttpClient) (string, string) {
return abck, bm_sz
}
func abckSensor(client tls_client.HttpClient, sensorurl string) {
func abckSensor(client tls_client.HttpClient, sensorurl string) string {
ua := ""
for i := 0; i < 5; i++ {
abck, bm_sz := getCookie(client)
//datas := fmt.Sprintf("times=%d&abck=%s&bm_sz=%s&url=%s", i, abck, bm_sz, "https://www.spirit.com/")
//
//r, _ := http.Post("http://127.0.0.1:3033/akm2t", "application/x-www-form-urlencoded", strings.NewReader(datas))
//rs, _ := io.ReadAll(r.Body)
rs := sensor2.GenData(i, abck, bm_sz, "Mozilla/5.0 (Linux; Android 9; SM-N9500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36", "https://www.spirit.com/")
datas := fmt.Sprintf("times=%d&abck=%s&bm_sz=%s&url=%s", i, abck, bm_sz, "https://www.spirit.com/")
r, _ := http.Post("http://127.0.0.1:3033/akm2t", "application/x-www-form-urlencoded", strings.NewReader(datas))
rs, _ := io.ReadAll(r.Body)
rsss := strings.Split(string(rs), "|||||")
//rs := sensor2.GenData(i, abck, bm_sz, "Mozilla/5.0 (Linux; Android 9; SM-N9500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36", "https://www.spirit.com/")
sensor := "{\"sensor_data\":\"" + string(rs) + "\"}"
sensor := "{\"sensor_data\":\"" + rsss[0] + "\"}"
req, _ := http.NewRequest("POST", "https://www.spirit.com"+sensorurl, strings.NewReader(sensor))
req.Header.Set("authority", "www.spirit.com")
req.Header.Set("accept", "*/*")
......@@ -48,21 +48,21 @@ func abckSensor(client tls_client.HttpClient, sensorurl string) {
req.Header.Set("origin", "https://www.spirit.com")
req.Header.Set("pragma", "no-cache")
req.Header.Set("referer", "https://www.spirit.com/")
req.Header.Set("user-agent", "Mozilla/5.0 (Linux; Android 9; SM-N9500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36")
req.Header.Set("user-agent", rsss[1])
resp, _ := client.Do(req)
readBytes, _ := io.ReadAll(resp.Body)
fmt.Println(string(readBytes))
for _, cookie := range resp.Cookies() {
fmt.Println(cookie.Name, len(cookie.Value), cookie.Value)
}
ua = rsss[1]
}
return ua
}
func main() {
wg := sync.WaitGroup{}
for i := 0; i < 1; i++ {
wg := &sync.WaitGroup{}
for i := 0; i < 10; i++ {
wg.Add(1)
go func() {
jar := tls_client.NewCookieJar()
......@@ -83,8 +83,8 @@ func main() {
tls_client.WithClientProfile(tls_client.Chrome_110),
tls_client.WithNotFollowRedirects(),
tls_client.WithCookieJar(jar), // create cookieJar instance and pass it as argument
//tls_client.WithProxyUrl("http://127.0.0.1:8890"),
tls_client.WithProxyUrl("http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600"),
tls_client.WithProxyUrl("http://127.0.0.1:8890"),
//tls_client.WithProxyUrl("http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600"),
//tls_client.WithProxyUrl(px),
tls_client.WithInsecureSkipVerify(),
}
......@@ -115,17 +115,16 @@ func main() {
panic(err)
}
fmt.Println(sensorurl)
abckSensor(client, sensorurl)
nk(client)
ua := abckSensor(client, sensorurl)
nk(client, ua)
wg.Done()
}()
}
wg.Wait()
}
func nk(client tls_client.HttpClient) {
func nk(client tls_client.HttpClient, ua string) {
//t1 := time.Now()
////resp, err := http.Post("http://lcc.unififi.com/akamai/gen",
//resp, err := http.Post("http://127.0.0.1:59001/akamai/gen",
......@@ -147,7 +146,7 @@ func nk(client tls_client.HttpClient) {
req.Header.Set("authority", "www.spirit.com")
req.Header.Set("accept", "application/json, text/plain, */*")
req.Header.Set("accept-language", "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6")
req.Header.Set("accept-language", "q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6")
req.Header.Set("cache-control", "no-cache")
req.Header.Set("content-type", "application/json")
req.Header.Set("origin", "https://www.spirit.com")
......@@ -155,11 +154,8 @@ func nk(client tls_client.HttpClient) {
req.Header.Set("referer", "https://www.spirit.com/")
req.Header.Set("sec-ch-ua-mobile", "?0")
req.Header.Set("ocp-apim-subscription-key", "dc6844776fe84b1c8b68affe7deb7916")
req.Header.Set("x-dtpc", "4$572764892_654h11vJJGIVPCDDJUIBEMACTPMIGRSISICHWMU-0e0")
req.Header.Set("sec-fetch-dest", "empty")
req.Header.Set("sec-fetch-mode", "cors")
req.Header.Set("sec-fetch-site", "same-origin")
req.Header.Set("user-agent", "Mozilla/5.0 (Linux; Android 9; SM-N9500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36")
//req.Header.Set("user-agent", "Mozilla/5.0 (Linux; Android 9; SM-N9500) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Mobile Safari/537.36")
req.Header.Set("user-agent", ua)
resp, err := client.Do(req)
if err != nil {
panic(err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment