-
Notifications
You must be signed in to change notification settings - Fork 74
/
中兴商城.py
59 lines (53 loc) · 1.95 KB
/
中兴商城.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
'''
功能:中兴商城任务
一天5毛买东西可抵扣
抓手机端签到请求链接里面的accessToken=后面的字符串(如dc487xxxx9d67)填到环境变量'zxscck'里,多账号&连接,网页版签到抓到的accessToken没有测试,有可能能用
cron: 3 0 * * *
new Env('中兴商城');
'''
import requests
import os
try:
from notify import send
except:
pass
url = "https://www.ztemall.com/index.php/topapi"
headers = {
"Accept": "*/*",
"platform": "android",
"C-Version": "5.2.32.2308151406",
"User-Agent": "Mozilla/5.0 (Linux; Android 8.0.0; MI 5 Build/OPR1.170623.032; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/68.0.3440.91 Mobile Safari/537.36",
"model": "MI 5",
"Accept-Encoding": "gzip",
"Host": "www.ztemall.com",
"Connection": "Keep-Alive"
}
accounts = os.getenv('zxscck')
if accounts is None:
print('未检测到zxscck')
exit(1)
accounts_list = accounts.split('&')
print(f"获取到 {len(accounts_list)} 个账号\n")
result = []
for i, account in enumerate(accounts_list, start=1):
print(f"=======开始执行账号{i}=======\n")
params = {
"method": "member.checkIn.add",
"format": "json",
"v": "v1",
"accessToken": account
}
response = requests.get(url, headers=headers, params=params).json()
if response['errorcode'] == 0:
currentCheckInPoint = response['data']['currentCheckInPoint']
point = response['data']['point']
print(f"账号{i}签到成功,获得{currentCheckInPoint}积分,当前积分:{point}\n")
result.append(f"账号{i}签到成功,获得{currentCheckInPoint}积分,当前积分:{point}\n")
else:
msg = response['msg']
print(f"账号{i}签到失败,{msg}\n")
result.append(f"账号{i}签到失败,{msg}\n")
try:
send("中兴商城签到",f"{''.join(result)}")
except Exception as e:
print(f"消息推送失败:{e}!\n{result}\n")