使用WPS实现阿里、夸克云盘自动签到
阿里云盘和夸克云盘每日签到可以领取空间容量,这对不想开会员的小伙伴非常友好
本来也可以利用Github进行托管的,但因为要使用到token和cookie,在Github上别人是可以看到你的token和cookie的,而且由于国内政策原因,不少人根本访问不到GitHub(/= _ =)/~┴┴
所以我们可以利用WPS的AirScript开发签到功能
打开WPS官网:https://www.kdocs.cn/
首先,我们新建一个空白表格
表格创建完成后我们就可以创建任务脚本了,点击效率
->高级开发
->AirScript脚本编辑器
即可创建一个属于我们的脚本。
并将下面的代码粘贴到文档共享脚本
里
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站签到
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()
}
// 夸克网盘签到
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 refreshToken = sheet.Columns("B").Rows(2).Text
let biliCookie = sheet.Columns("B").Rows(3).Text
let kkCookie = sheet.Columns("B").Rows(4).Text
let jdCookie = sheet.Columns("B").Rows(5).Text
if (refreshToken!=""){
aliPanSign(refreshToken,pushPlusToken)
}
if (biliCookie!=""){
biliSign(biliCookie,pushPlusToken)
}
if (kkCookie!=""){
kkSign(kkCookie,pushPlusToken)
}
if(jdCookie!=""){
jdSign(jdSign,pushPlusToken)
}
}
main()
点击服务授权添加三个服务,分别是云文档、网络和邮件。
然后我们返回到表格页面,A列
按照我这个顺序写进去,B列
就填对应的配置。
在A列备注好对应的名字,随意填写,自己记住就行。B列按顺序填写好对应的token或者cookie,然后就可以点击执行脚本啦
不会获取token或者cookie的小伙伴自行百度一下
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 Yukuii
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果