Loading...

WPS网盘签到(2)

日常推荐4个月前更新 Jone
201 0 0

应后台小伙伴要求,WPS签到支持多用户了。

WPS网盘签到(2)

整个wps表格A列还是按照这样排列,依次是pushplus阿里云B站夸克京东。除了pushplus那一行,剩下四行每一列都可以放置一个cookie,也就是可以支持多个用户签到了。

WPS网盘签到(2)

就比如我这个,分别在B列和C列我放了两个不同cookie,同理如果你有更多账户的话依次往后面放就行。

WPS网盘签到(2)

这里我就夸克放了两个账户,可以看到签到了两次。

代码具体实现:

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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
  let userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0"

//pushPlus推送
function pushplus(pushPlusToken,title,content){
let url = "http://www.pushplus.plus/send/"
let body = {
"token":pushPlusToken,
"title":title,
"content":content
}
post(url,{
userAgent:userAgent,
'Content-Type': 'application/json'
},body)
Time.sleep(1000)
}

//京东签到
function jdSign(cookie,pushPlusToken) {
let url = "https://api.m.jd.com/client.action?functionId=signBeanAct&body=%7B%22fp%22%3A%22-1%22%2C%22shshshfp%22%3A%22-1%22%2C%22shshshfpa%22%3A%22-1%22%2C%22referUrl%22%3A%22-1%22%2C%22userAgent%22%3A%22-1%22%2C%22jda%22%3A%22-1%22%2C%22rnVersion%22%3A%223.9%22%7D&appid=ld&client=apple&clientVersion=10.0.4&networkType=wifi&osVersion=14.8.1"
let data = post(url,{
cookie:cookie,
userAgent:userAgent
},null)
if (data["code"]!="0"){
pushplus(pushPlusToken,"京东每日签到","签到失败"+data["errorMessage"])
console.log("签到失败"+data["errorMessage"])
}else{
let dailyAward
if (data["data"]["dailyAward"]!=null){
dailyAward = data["data"]["dailyAward"]
} else if (data["data"]["continuityAward"]) {
dailyAward = data["data"]["continuityAward"]
}
pushplus(pushPlusToken,"京东每日签到",dailyAward["title"]+dailyAward["beanAward"]["beanCount"]+"京豆")
console.log(dailyAward["title"]+dailyAward["beanAward"]["beanCount"]+"京豆")
}
}

//B站签到
/**
* @param {any} cookie
* @param {any} pushPlusToken
*/
function biliSign(cookie,pushPlusToken){
let url = "https://api.live.bilibili.com/xlive/web-ucenter/v1/sign/DoSign"
let data = get(url,{
'Cookie':cookie,
userAgent:userAgent
})
if (data["code"]!=null){
if (data["code"]==0){
pushplus(pushPlusToken,"B站直播签到",data["data"]["text"])
console.log(data["data"]["text"])
}else{
pushplus(pushPlusToken,"B站直播签到",data["message"])
console.log(data["message"])
}
}
}

//获取accessToken
function getAccessToken(refreshToken,pushPlusToken) {
let url = "https://auth.aliyundrive.com/v2/account/token"
let body = {
"grant_type":"refresh_token",
"refresh_token":refreshToken
}
let data = post(url,{
userAgent:userAgent,
'Content-Type': 'application/json'
},body)
if (data["access_token"]==null){
pushplus(pushPlusToken,"阿里云盘自动签到","refreshToken过期,请更改后重试")
console.log("refreshToken过期,请更改后重试")
return null
} else {
return data["access_token"]
}
}

//获取签到次数
function signIn(accessToken,pushPlusToken) {
let url = "https://member.aliyundrive.com/v1/activity/sign_in_list"
let body = {
"_rx-s":"mobile"
}
let data = post(url,{
'Content-Type': 'application/json',
userAgent:userAgent,
'Authorization':accessToken
},body)
if (data["result"]["signInCount"]!=null){
return data["result"]["signInCount"]
} else {
return null
}
}

//签到并获取奖励
function getReward(accessToken,signInCount,pushPlusToken) {
let url = "https://member.aliyundrive.com/v1/activity/sign_in_reward?_rx-s=mobile"
let body = {
"signInDay":signInCount
}
let data = post(url,{
'Content-Type': 'application/json',
userAgent:userAgent,
'Authorization':accessToken
},body)
if (data["result"]["notice"]!=null){
return data["result"]["notice"]
} else {
pushplus(pushPlusToken,"阿里云盘自动签到","获取奖励失败")
console.log("获取奖励失败")
return null
}
}

//阿里云盘签到入口
function aliPanSign(refreshToken,pushPlusToken) {
let accessToken = getAccessToken(refreshToken,pushPlusToken)
if (accessToken!=null){
let signCount = signIn(accessToken,pushPlusToken)
if (signCount!=null){
let reward = getReward(accessToken,signCount,pushPlusToken)
if (reward!=null){
pushplus(pushPlusToken,"阿里云盘自动签到","签到成功,你已经签到"+signCount+"次,本次签到奖励————"+reward)
console.log(reward)
}
}
}
}

//封装请求
function get(url,headers) {
return HTTP.get(url, {
headers: headers,
}).json()
}

function post(url,headers,data){
return HTTP.post(url, typeof data == 'string' ? data : JSON.stringify(data), {
headers: headers,
}).json()
}

// 夸克网盘签到
/**
* @param {any} cookie
* @param {any} pushPlusToken
*/
function kkSign(cookie,pushPlusToken) {
let url = "https://drive-m.quark.cn/1/clouddrive/capacity/growth/info?pr=ucpro&fr=pc&uc_param_str="
let data = HTTP.fetch(url,{
headers:{
cookie:cookie,
userAgent:userAgent
},
method:"GET"
}).json()
let isSign = data["data"]["cap_sign"]["sign_daily"]
if (isSign) {
let reward = data["data"]["cap_sign"]["sign_daily_reward"]/(1024 * 1024)
pushplus(pushPlusToken,"夸克网盘每日签到","今天已经签到过了,获得容量"+reward+"MB")
console.log("今天已经签到过了,获得容量"+reward+"MB")
} else {
let signUrl = "https://drive-m.quark.cn/1/clouddrive/capacity/growth/sign?pr=ucpro&fr=pc&uc_param_str="
let body = {
"sign_cyclic":"True"
}
let data = HTTP.fetch(signUrl,{
method:"POST",
headers:{
cookie:cookie,
userAgent:userAgent
},
body:JSON.stringify(body)
})
console.log(data)
let reward = data["data"]["sign_daily_reward"] / (1024*1024)
pushplus(pushPlusToken,"夸克网盘每日签到","签到成功,今日签到奖励"+reward+"MB")
console.log("签到成功,今日签到奖励"+reward+"MB")
}
}

function main() {
let sheet = Application.Sheets.Item("Sheet1") || ActiveSheet
let pushPlusToken = sheet.Columns("B").Rows(1).Text
let currentSheet = Application.Sheets.Item("Sheet1") || ActiveSheet
const usedRange = currentSheet.UsedRange
for (rowNumber = 2; rowNumber <= 5; rowNumber++) {
const rowToGet = currentSheet.Rows(rowNumber)
for (let column = usedRange.Column; column <= usedRange.Column + usedRange.Columns.Count - 1; column++) {
if (column === 1) {
continue
}
const cell = rowToGet.Columns(column)
if (cell.Text == "") {
continue
}
switch (rowNumber) {
case 2:
aliPanSign(cell.Text,pushPlusToken)
break
case 3:
biliSign(cell.Text,pushPlusToken)
break
case 4:
kkSign(cell.Text,pushPlusToken)
break
case 5:
jdSign(cell.Text,pushPlusToken)
}
}
}
}

main()

和之前差不多,这个代码替换你之前的就行了。

闲聊

调休,调奶奶个腿,老子双休被调成单休了。

要不咱放不起就别放,拆东墙补西墙真tm恶心!

© 版权声明

相关文章