-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtestnet.lenscan.io.py
88 lines (74 loc) · 2.3 KB
/
testnet.lenscan.io.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# -*- coding: utf-8 -*-
# @Time : 2025/3/2 20:46
# @Author : Chris
# @Email : [email protected]
# @File : testnet.lenscan.io.py
# @Software: PyCharm
# -*- coding: UTF-8 -*-
import requests
from pynocaptcha import CloudFlareCracker
# 根据实际情况修改
from utils import __TOKEN__, __PROXY__NST__V6
# 平台注册地址 https://goo.su/i2dKzY 获取令牌
USER_TOKEN = __TOKEN__
# cf和这个平台都支持 ipv6代理 注册地址 https://goo.su/wXmzLan
# 我推荐的这个代理平台是 $0.4 1gb,非常便宜,当然如果你有更便宜的也可以直接用。
proxy = __PROXY__NST__V6
difficulty = "hard"
session = requests.session()
headers = {
"accept": "*/*",
"accept-language": "zh-CN,zh;q=0.9",
"content-type": "application/json",
"priority": "u=1, i",
"referer": "https://testnet.lenscan.io/faucet",
"sec-ch-ua": "\"Not(A:Brand\";v=\"99\", \"Google Chrome\";v=\"133\", \"Chromium\";v=\"133\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"trpc-accept": "application/jsonl",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
"x-trpc-source": "nextjs-react"
}
resp = requests.post("http://api.nocaptcha.cn/api/wanda/lenscan/universal", headers={
"User-Token": USER_TOKEN
}, json={
"difficulty": difficulty,
}).json()
print(resp)
data = resp["data"]
sessionId = data["sessionId"]
moves = data["moves"]
cracker = CloudFlareCracker(
internal_host=True,
user_token=USER_TOKEN,
href="https://testnet.lenscan.io/faucet",
sitekey="0x4AAAAAAA1z6BHznYZc0TNL",
debug=False,
show_ad=False,
proxy=proxy,
timeout=60
)
ret = cracker.crack()
print(ret)
token = ret.get("token")
url = "https://testnet.lenscan.io/api/trpc/faucet.claim"
params = {"batch": "1"}
data = {
"0": {
"json": {
"address": "0x1e778b081e145228f6de493ef51b13e3075efee2",
"cfToken": token,
"gameChallenge": {
"sessionId": sessionId,
"moves": moves
}
}
}
}
response = session.post(url, json=data, headers=headers, params=params, proxies={
"all": proxy
})
print(response.text)