-
Notifications
You must be signed in to change notification settings - Fork 46
/
一点万象.py
81 lines (72 loc) · 3.75 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/python3
# -- coding: utf-8 --
# 原作者
# @Author : github@wd210010 https://github.com/wd210010/just_for_happy
# @Time : 2023/2/27 13:23
# -------------------------------
'''
cron: 17 8 * * *
const $ = new Env('一点万象签到')
fix 20240625 ArcadiaScriptPublic 频道:https://t.me/ArcadiaScript 群组:https://t.me/ArcadiaScriptPublic
修改描述
#登录后搜索https://app.mixcapp.com/mixc/gateway域名随意一个 请求体里面的deviceParams,token 多账号填多个单引号里面 用英文&隔开
ydwx_deviceParams 值deviceParams1&deviceParams2
ydwx_token 值token1&token2
'''
import requests,time,hashlib,json
import os
# 本地运行用取消下面两行注释 并注释掉青龙变量的两行变量
# ydwx_deviceParams=['deviceParams1','deviceParams2']
# ydwx_token =['token1','token2']
# 青龙变量 ydwx_deviceParams ydwx_token
ydwx_deviceParams = os.getenv("ydwx_deviceParams").split('&')
ydwx_token = os.getenv("ydwx_token").split('&')
#推送加 token
plustoken = os.getenv("plustoken")
def Push(contents):
# plustoken推送
headers = {'Content-Type': 'application/json'}
json = {"token": plustoken, 'title': '一点万向签到', 'content': contents.replace('\n', '<br>'), "template": "json"}
resp = requests.post(f'http://www.pushplus.plus/send', json=json, headers=headers).json()
print('push+推送成功' if resp['code'] == 200 else 'push+推送失败')
print(f'共配置了{len(ydwx_deviceParams)}个账号')
log = []
for i in range(len(ydwx_deviceParams)):
print(f'*****第{str(i+1)}个账号*****')
timestamp = str(int(round(time.time() * 1000)))
md5 = hashlib.md5()
md52 = hashlib.md5()
sig = f'action=mixc.app.memberSign.sign&apiVersion=1.0&appId=68a91a5bac6a4f3e91bf4b42856785c6&appVersion=3.53.0&deviceParams={ydwx_deviceParams[i]}&imei=2333&mallNo=20014&osVersion=12.0.1¶ms=eyJtYWxsTm8iOiIyMDAxNCJ9&platform=h5×tamp={timestamp}&token={ydwx_token[i]}&P@Gkbu0shTNHjhM!7F' # 创建md5加密对象
md5.update(sig.encode('utf-8')) # 指定需要加密的字符串
sign = md5.hexdigest() # 加密后的字符串
url = 'https://app.mixcapp.com/mixc/gateway'
headers= {
'Host': 'app.mixcapp.com',
'Connection': 'keep-alive',
'Content-Length': '564',
'Accept': 'application/json, text/plain, */*',
'Origin': 'https://app.mixcapp.com',
'User-Agent': 'Mozilla/5.0 (Linux; Android 10; PCAM00 Build/QKQ1.190918.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.92 Mobile Safari/537.36/MIXCAPP/3.42.2/AnalysysAgent/Hybrid',
'Sec-Fetch-Mode': 'cors',
'Content-Type': 'application/x-www-form-urlencoded',
'X-Requested-With': 'com.crland.mixc',
'Sec-Fetch-Site': 'same-origin',
'Referer': 'https://app.mixcapp.com/m/m-20014/signIn?showWebNavigation=true×tamp=1676906528979&appVersion=3.53.0&mallNo=20014',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7'
}
data =f'mallNo=20014&appId=68a91a5bac6a4f3e91bf4b42856785c6&platform=h5&imei=2333&appVersion=3.53.0&osVersion=12.0.1&action=mixc.app.memberSign.sign&apiVersion=1.0×tamp={timestamp}&deviceParams={ydwx_deviceParams[i]}&token={ydwx_token[i]}¶ms=eyJtYWxsTm8iOiIyMDAxNCJ9&sign={sign}'
html = requests.post(url=url,headers=headers,data=data)
print(html.text)
result = f'帐号{i+1}签到响应结果:'+'' +json.loads(html.text)['message']
res='' +json.loads(html.text)['message']
print(res)
if res=='成功' or res=='今日已签到,不可重复签到':
result = f'帐号{i+1}签到结果:'+'成功'
else:
result = f'帐号{i+1}签到结果:'+'失败'
print(result)
log.append(result)
# log2 = str(log).replace('[\'','').replace('\']','').replace(':','\n').replace('\', \'','\n')
# print(log2)
# Push(contents=log2)