5-1 更新逻辑

This commit is contained in:
yml2213
2022-05-01 16:59:11 +08:00
parent 592f13bff4
commit 8c75024498
+70 -36
View File
@@ -1,10 +1,12 @@
/**
* 超有惠 app (链接带邀请) 感谢您走我的邀请链接,谢谢,谢谢,谢谢
* 下载地址: https://m.chyouhui.com/page/invite/#/?code=I92CCI7
* 转载请留信息
*
* cron 30 7 * * * yml2213_javascript_master/cyh.js
*
* 4-30 完成 签到 , 日常视频 任务
* 5-1 更新逻辑
* 新人任务自己做做吧 很少
*
* 感谢所有测试人员
@@ -29,7 +31,7 @@ let ad_video_infoArr = '';
/////////////////////////////////////////////////////////
async function tips(ckArr) {
console.log(`\n版本: 0.2 -- 22/5/1`);
console.log(`\n版本: 0.3 -- 22/5/1`);
// console.log(`\n 脚本已恢复正常状态,请及时更新! `);
console.log(`\n 脚本测试中,有bug及时反馈! \n`);
console.log(`\n 脚本测试中,有bug及时反馈! \n`);
@@ -73,12 +75,12 @@ async function tips(ckArr) {
async function start() {
console.log("开始 用户信息");
console.log("开始 用户/积分信息");
await userInfo();
await $.wait(2 * 1000);
console.log("开始 签到");
await signin();
console.log("开始 签到状态");
await signin_info();
await $.wait(2 * 1000);
console.log("开始 检查视频状态");
@@ -110,13 +112,72 @@ async function userInfo(timeout = 3 * 1000) {
console.log(
`\n 用户信息:${result.message} 🎉 \n欢迎光临:${result.data.username} , 等级:${result.data.currentGrade} \n`
);
await integral_info();
msg += `\n 用户信息:成功 🎉 签到获得 积分 ${result.data} \n`
} else {
console.log(`\n 用户信息: ${result.message} \n `);
}
}
/**
* 积分信息 get
* https://t-api.chyouhui.com/auth/sellIntegral/wallet
*/
async function integral_info(timeout = 3 * 1000) {
let url = {
url: `https://t-api.chyouhui.com/auth/sellIntegral/wallet`,
headers: {
'androidToken': ck[0],
'Host': 't-api.chyouhui.com',
},
// body: '{}',
};
let result = await httpGet(url, `积分信息`, timeout);
if (result.code == 0) {
console.log(`\n 总积分:${result.data.myIntegral} , 可出售:${result.data.convertibleIntegral} , 可提现金额:${result.data.withdrawAmount} 元 \n`);
} else {
console.log(`\n 积分信息: ${result.message} \n `);
}
}
/**
* 签到状态 get
* https://t-api.chyouhui.com/auth/dailySignIn/data
*/
async function signin_info(timeout = 3 * 1000) {
let url = {
url: `https://t-api.chyouhui.com/auth/dailySignIn/data`,
headers: {
'androidToken': ck[0],
'Host': 't-api.chyouhui.com',
},
// body: '',
};
let result = await httpGet(url, `签到状态`, timeout);
if (result.code == 0) {
console.log(`\n 签到状态: ${result.message} 🎉 \n`);
if (result.data.todayState !== 'SIGN') {
console.log(`没有签到,去签到!`);
await signin();
} else {
console.log(`今天已经签到了,明天再来吧!`);
}
} else {
console.log(`\n 签到状态: ${result.message} \n `);
}
}
/**
* 签到 post
* https://t-api.chyouhui.com/auth/dailySignIn/completed
@@ -126,7 +187,7 @@ async function signin(timeout = 3 * 1000) {
let url = {
url: `https://t-api.chyouhui.com/auth/dailySignIn/completed`,
headers: {
'androidToken': ck,
'androidToken': ck[0],
'Host': 't-api.chyouhui.com',
},
body: '{}',
@@ -145,6 +206,7 @@ async function signin(timeout = 3 * 1000) {
}
/**
* 检查视频状态 get
* https://t-api.chyouhui.com/auth/watchVideo/pageData
@@ -154,7 +216,7 @@ async function ad_video_info(timeout = 3 * 1000) {
let url = {
url: `https://t-api.chyouhui.com/auth/watchVideo/pageData`,
headers: {
'androidToken': ck,
'androidToken': ck[0],
'Host': 't-api.chyouhui.com',
},
// body: '{}',
@@ -200,7 +262,7 @@ async function ad_video(timeout = 3 * 1000) {
let url = {
url: `https://t-api.chyouhui.com/auth/watchVideo/completed/${ad_num}`,
headers: {
'androidToken': ck,
'androidToken': ck[0],
'Host': 't-api.chyouhui.com',
},
};
@@ -221,34 +283,6 @@ async function ad_video(timeout = 3 * 1000) {
/**
* 观看视频 post
* https://t-api.chyouhui.com/auth/watchVideo/completed/6
*/
async function ad_video1(timeout = 3 * 1000) {
let url = {
url: `https://t-api.chyouhui.com/auth/watchVideo/completed/${ad_num}`,
headers: {
'androidToken': ck,
'Host': 't-api.chyouhui.com',
},
};
let result = await httpPost(url, `观看视频`, timeout);
if (result.code == 0) {
console.log(
`\n 观看视频:${result.message} 🎉 , 下一个视频是第 ${result.data.nextId} 个视频 \n 本次观看视频获得积分 ${result.data.integral} ,剩余未领取积分 ${result.data.surplusIntegral}\n`
);
} else if (result.code == -1) {
console.log(`\n 观看视频:${result.message} \n`);
} else {
console.log(`\n 观看视频: 失败 ❌ 了呢,原因未知!\n ${result} \n `);
}
}