Browse Source

更新答题

main
haptear 3 years ago
parent
commit
ab32b82f6f
  1. 166
      dati/dati_yq_auto.js

166
dati/dati_yq_auto.js

@ -9,7 +9,7 @@ const Agent = $.isNode() ? require('./JS_USER_AGENTS') : '';
let envSplitor = ['\n', '@', '&'] let envSplitor = ['\n', '@', '&']
//let httpResult, httpReq, httpResp //let httpResult, httpReq, httpResp
// process.env.cgzjgCookie = '23788d36ea6510e04caef01d89ade0ca' // process.env.cgzjgCookie = '23788d36ea6510e04caef01d89ade0ca'
//process.env.dtsign = '70681'; // process.env.dtsign = '70681';
let userCookie = ($.isNode() ? process.env.dtsign : $.getdata('dtsign')) || ''; let userCookie = ($.isNode() ? process.env.dtsign : $.getdata('dtsign')) || '';
let userList = [] let userList = []
@ -23,39 +23,41 @@ class UserInfo {
this.amount = 0; this.amount = 0;
this.USER_AGENT = Agent.GetUserAgent(); this.USER_AGENT = Agent.GetUserAgent();
this.imei = ''; this.imei = '';
this.invitusers=[]; this.invitusers = [];
} }
async start () { async start () {
await this.updateInfo(this.userid) var mainUserInfo = await this.GetUserInfo(this.userid)
if (this.imei) { if (mainUserInfo.imei) {
//登录 //登录
await $.wait(200) await $.wait(200)
await this.userLogin(this.imei); await this.userLogin(mainUserInfo.imei);
} }
//1. 获取邀请的数量,不够30个邀请到30个,每次邀请10个 //1. 获取邀请的数量,不够30个邀请到30个,每次邀请10个
await this.GetInvitUsers(this.userid,0); //{"invitationallmoney":"0","invitationnum":"70","invitationmoney":"65.00","invitationcash":"100"}
if (!this.invitusers)
return;
if (this.invitusers.length < 70) { let invitationnum = Number.parseInt(mainUserInfo.invitationnum);
await this.InvitMoreUser(this.userid, 70-this.invitusers.length); //补够70个邀请
this.invitusers=[]; if (invitationnum < 70) {
await this.GetInvitUsers(this.userid,0); await this.InvitMoreUser(this.userid, 70 - invitationnum);
} }
await this.GetInvitUsers(this.userid, 0);
if (!this.invitusers)
return;
//2. 每个邀请账号刷红包提现 //2. 每个邀请账号刷红包提现
let indexNumber=0; let indexNumber = 0;
for (var user of this.invitusers) { for (var user of this.invitusers) {
console.log(`\n==${indexNumber++} ${this.userid} 用户:${user.userid} 刷满5000红包==`) console.log(`\n==${indexNumber++} ${this.userid} 用户:${user.userid} 刷满5000红包==`)
this.amount = 0; this.amount = 0;
this.imei=''; this.imei = '';
await this.updateInfo(user.userid) let subUserInfo = await this.GetUserInfo(user.userid)
if (this.imei) { if (subUserInfo.imei) {
//登录 //登录
await $.wait(200) await $.wait(200)
await this.userLogin(this.imei); await this.userLogin(subUserInfo.imei);
} }
await $.wait(200) await $.wait(200)
@ -64,14 +66,20 @@ class UserInfo {
} }
if (this.amount > 3000) { if (this.amount > 3000) {
console.log(`开始抽奖卷`) console.log(`${user.userid} 开始抽奖卷`)
this.txflag = 0 this.txflag = 0
await this.onCheck(user.userid) await this.onCheck(user.userid)
} }
} }
//3. 邀请金额如果可以提现,则自动提现 //3. 邀请金额如果可以提现,则自动提现
mainUserInfo = await this.GetUserInfo(this.userid)
let invitationmoney = Number.parseInt(mainUserInfo.invitationmoney);
if(invitationmoney>50)
{
await this.CashInvite(this.userid,invitationmoney);
}
console.log(`${user.userid} 邀请金额:${invitationmoney}`)
} }
encrypt (str, timestamp, userid, type) { encrypt (str, timestamp, userid, type) {
@ -95,7 +103,59 @@ class UserInfo {
return sign return sign
} }
async GetInvitUsers (userid,page) { //邀请提现
async CashInvite (userid,money) {
let url = 'http://dati.dspmz.com/idiomgame/?s=/CashOutInfo/onCashInvite'
let timestamp = + new Date()
let sign = this.encrypt1(userid + timestamp);
//提现类型 1007(50元) 1008(100) 1009(1050)
let cashType = money >= 150 ? 1009 : (money >= 100 ? 1008 : 1007);
//&userId=70681&index=1007&timeStamp=1656916485058&sign=e95d8e689448cbe51e75388e03fb6662
//70681165691648505845^dk,mxcjwejk54d152
let body = `&userId=${userid}&index=${cashType}&timeStamp=${timestamp}&sign=${sign}`
let urlObject = populateUrlObject(url, body, this.USER_AGENT)
let httpResultContext = {};
await httpRequest('post', urlObject, httpResultContext)
let httpResult = httpResultContext.Result
if (!httpResult || httpResult.statusCode != 200) { return undefined; }
//{"code":-2}
let result = JSON.parse(httpResult.body);
if (!result) return undefined;
if (result.code ==1) {
console.log(`账号${userid} 提现:${money}成功`);
}
else {
console.log(`账号${userid} 提现:${money} 失败: ${httpResult.body}`);
}
}
//获取邀请信息
async GetInviteInfo (userid) {
let url = 'http://dati.dspmz.com/idiomgame/?s=/UserInfo/inviteInfo'
let timestamp = + new Date()
let sign = this.encrypt1(userid + timestamp);
//&userId=70681&timeStamp=1656901690735&sign=6010ffb8b19bd952421ed90303447460
//70681165690169073545^dk,mxcjwejk54d152
let body = `&userId=${userid}&timeStamp=${timestamp}&sign=${sign}`
let urlObject = populateUrlObject(url, body, this.USER_AGENT)
let httpResultContext = {};
await httpRequest('post', urlObject, httpResultContext)
let httpResult = httpResultContext.Result
if (!httpResult || httpResult.statusCode != 200) { return undefined; }
//{"data":{"invitationallmoney":"0","invitationnum":"70","invitationmoney":"65.00","invitationcash":"100"},"code":0}
let result = JSON.parse(httpResult.body);
if (!result) return undefined;
if (result.code == 0) {
return result.data;
}
else {
console.log(`账号${userid} 获取邀请信息失败: ${httpResult.body}`);
return undefined;
}
}
async GetInvitUsers (userid, page) {
let url = 'http://dati.dspmz.com/idiomgame/?s=/InviCash/getRecord' let url = 'http://dati.dspmz.com/idiomgame/?s=/InviCash/getRecord'
let timestamp = + new Date() let timestamp = + new Date()
let sign = this.encrypt1(userid + timestamp + page); let sign = this.encrypt1(userid + timestamp + page);
@ -112,8 +172,8 @@ class UserInfo {
if (result.success == 1) { if (result.success == 1) {
console.log(`账号${userid} 邀请数为:${result.data.length}`); console.log(`账号${userid} 邀请数为:${result.data.length}`);
this.invitusers.push(...result.data); this.invitusers.push(...result.data);
if(result.data.length==30) if (result.data.length == 30)
await this.GetInvitUsers (userid,++page) await this.GetInvitUsers(userid, ++page)
} }
else { else {
console.log(`账号${userid} 获取邀请数据错误: ${JSON.stringify(result)}`); console.log(`账号${userid} 获取邀请数据错误: ${JSON.stringify(result)}`);
@ -130,9 +190,10 @@ class UserInfo {
await $.wait(200) await $.wait(200)
//注册行账号 并绑定支付宝账号 //注册行账号 并绑定支付宝账号
var newUserid = await this.registCount(); var newUserid = await this.registCount();
if (newUserid) { console.log(`账号${userid} 新增邀请 ${newUserid}`);
await this.updateInfo(newUserid) // if (newUserid) {
} // await this.updateInfo(newUserid)
// }
await $.wait(200) await $.wait(200)
} }
} }
@ -189,12 +250,13 @@ class UserInfo {
//{"redcoupons":"291","addRed":261,"code":0} //{"redcoupons":"291","addRed":261,"code":0}
if (result.code == 0) { if (result.code == 0) {
this.amount = result.redcoupons this.amount = result.redcoupons
console.log(`账号红包:${result.redcoupons} 增加:${result.addRed}`); if (this.amount > 5000)
if (this.amount < 5000) await $.wait(Math.floor(Math.random() * 1000) + 1000), await this.updateRedCoupons(userid); console.log(`${this.userid}-${userid}账号红包:${result.redcoupons} 增加:${result.addRed}`);
if (this.amount < 5000) await $.wait(Math.floor(Math.random() * 1000) + 100), await this.updateRedCoupons(userid);
} else console.log(`${JSON.stringify(result)}`) } else console.log(`${JSON.stringify(result)}`)
} }
async updateInfo (userid) { async GetUserInfo (userid) {
let url = 'http://dati.dspmz.com/idiomgame/?s=/UserInfo/updateInfo' let url = 'http://dati.dspmz.com/idiomgame/?s=/UserInfo/updateInfo'
let timestamp = + new Date() let timestamp = + new Date()
let sign = this.encrypt('', '', userid) let sign = this.encrypt('', '', userid)
@ -205,7 +267,11 @@ class UserInfo {
let httpResult = httpResultContext.Result let httpResult = httpResultContext.Result
if (!httpResult || httpResult.statusCode != 200) { return; } if (!httpResult || httpResult.statusCode != 200) { return; }
let result = JSON.parse(httpResult.body); let result = JSON.parse(httpResult.body);
if (!result) return //{"imei":"b48992a3-765f-44f7-a62d-fd40b57c0992","channelid":"mzdyj_gf","openid":null,"alipayaccount":"13072885408","alipayname":"\\u6731\\u5fd7\\u6e05","userid":"70681",
//"nickname":" ","headimage":null,"money":"-0.30","phonenum":"0","invitationcode":"0","invitationnum":"70","invitationmoney":"15.50",
//"answernum":"11","logintime":"2022-07-04 08:16:12","redcoupons":"2108","invitationallmoney":"0",
//"invitationcash":"150","limitnum":"0","ver":{"ver":"1.0.5","path":"https:\\/\\/wifipic.valuecome.com\\/app\\/mzdyj_gf.apk","contents":"\\u4f18\\u5316\\u5df2\\u77e5\\u95ee\\u9898\\uff0c\\u589e\\u52a0\\u9898\\u5e93\\u3002"},"stateType":"0","limitSubject":100,"subjectNum":50,"code":0}
if (!result) return undefined;
//console.log(`${JSON.stringify(result)}`) //console.log(`${JSON.stringify(result)}`)
if (result.code == 0) { if (result.code == 0) {
this.imei = result.imei || '' this.imei = result.imei || ''
@ -217,8 +283,11 @@ class UserInfo {
if (aliname) var newname = aliname.substr(0, 1) + '**' + aliname.substr(2) if (aliname) var newname = aliname.substr(0, 1) + '**' + aliname.substr(2)
this.amount = result.redcoupons this.amount = result.redcoupons
console.log(`绑定:${tel}-${aliname} 答题次数:${result.answernum} 金币数:${this.amount}`); console.log(`绑定:${tel}-${aliname} 答题次数:${result.answernum} 金币数:${this.amount}`);
return this.imei; return result;
} else console.log(`${JSON.stringify(result)}`) } else {
console.log(`${JSON.stringify(result)}`);
return undefined;
}
} }
async onAdClick (userid) { async onAdClick (userid) {
@ -255,27 +324,27 @@ class UserInfo {
if (!result) return if (!result) return
//console.log(`${JSON.stringify(result)}`) //console.log(`${JSON.stringify(result)}`)
if (result.code == 0) { //提现广告次数不够 if (result.code == 0) { //提现广告次数不够
console.log(`提现卷抽奖:提现广告完成${result.task.curclick}/${result.task.looknum} 提现请求:${result.cashnum}`); console.log(`${this.userid}-${userid} 提现卷抽奖:提现广告完成${result.task.curclick}/${result.task.looknum} 提现请求:${result.cashnum}`);
if (result.cashnum <= 3) { if (result.cashnum <= 3) {
if (result.task.curclick < 3) { if (result.task.curclick < 3) {
console.log(`刷提现广告`) console.log(`${this.userid}-${userid} 刷提现广告`)
let k = 3 - result.task.curclick; let k = 3 - result.task.curclick;
for (let i = 0; i < k; i++) { for (let i = 0; i < k; i++) {
await $.wait(200) await $.wait(200)
await this.onAdClick(userid) await this.onAdClick(userid)
await $.wait(Math.floor(Math.random() * 3000) + 1000) await $.wait(Math.floor(Math.random() * 1000) + 1000)
} }
} }
if (this.txflag == 1) { if (this.txflag == 1) {
console.log(`开始获取订单号`) console.log(`${this.userid}-${userid} 开始获取订单号`)
await $.wait(2000) await $.wait(Math.floor(Math.random() * 1000))
await this.getorderId(userid) await this.getorderId(userid)
} else console.log(`刷提现广告失败,跳过`) } else console.log(`${this.userid}-${userid} 刷提现广告失败,跳过`)
} else console.log(`超过今日提现次数,跳过`) } else console.log(`${this.userid}-${userid} 超过今日提现次数,跳过`)
} else { } else {
console.log(`提现广告已完成`) console.log(`${this.userid}-${userid} 提现广告已完成`)
console.log(`开始获取订单号`) console.log(`${this.userid}-${userid} 开始获取订单号`)
await $.wait(2000) await $.wait(Math.floor(Math.random() * 1000))
await this.getorderId(userid) await this.getorderId(userid)
} }
} }
@ -297,15 +366,15 @@ class UserInfo {
if (!result) return if (!result) return
if (result.code == 1) { if (result.code == 1) {
let orderId = result.orderId let orderId = result.orderId
console.log(`订单号:${result.orderId}`); console.log(`${this.userid}-${userid} 订单号:${result.orderId}`);
console.log(`开始提现`) console.log(`${this.userid}-${userid} 开始提现`)
await $.wait(2000) await $.wait(2000)
await this.cashOrder(userid,orderId) await this.cashOrder(userid, orderId)
} }
} }
async cashOrder (userid,orderId) { async cashOrder (userid, orderId) {
let url = 'http://dati.dspmz.com/idiomgame/?s=/CashOutInfo/cashOrder' let url = 'http://dati.dspmz.com/idiomgame/?s=/CashOutInfo/cashOrder'
let timestamp = + new Date() let timestamp = + new Date()
let sign = this.encrypt(orderId, timestamp, userid, 2) let sign = this.encrypt(orderId, timestamp, userid, 2)
@ -322,7 +391,7 @@ class UserInfo {
if (!result) return if (!result) return
//console.log(`${JSON.stringify(result)}`) //console.log(`${JSON.stringify(result)}`)
if (result.code == 1) { if (result.code == 1) {
console.log(`提现:${result.price} 剩余:${result.data.redcoupons}`); console.log(`${this.userid}-${userid} 提现:${result.price} 剩余:${result.data.redcoupons}`);
} else console.log(`${JSON.stringify(result)}`) } else console.log(`${JSON.stringify(result)}`)
} }
//提现列表 //提现列表
@ -373,11 +442,12 @@ class UserInfo {
} else console.log(`${JSON.stringify(result)}`) } else console.log(`${JSON.stringify(result)}`)
} }
async userLogin (IMEI) { async userLogin (imei) {
//http://dati.dspmz.com/idiomgame/?s=/UserInfo/userLogin //http://dati.dspmz.com/idiomgame/?s=/UserInfo/userLogin
//&IMEI=9fbdbfc9983c87c1f2ad3266a8d841cb&msaOAID=&verSDK=29&activeIP=&channelId=win_channel_1 //&IMEI=9fbdbfc9983c87c1f2ad3266a8d841cb&msaOAID=&verSDK=29&activeIP=&channelId=win_channel_1
let url = 'http://dati.dspmz.com/idiomgame/?s=/UserInfo/userLogin' let url = 'http://dati.dspmz.com/idiomgame/?s=/UserInfo/userLogin'
let body = `&IMEI=${IMEI}&msaOAID=&verSDK=29&activeIP=&channelId=win_channel_1` let body = `&IMEI=${imei}&msaOAID=&verSDK=24&activeIP=&channelId=mzdyj_gf`
//let body = `&IMEI=${IMEI}&msaOAID=&verSDK=24&activeIP=&channelId=mzdyj_gf`
//console.log(body) //console.log(body)
//let body="&userId=67397&timeStamp=1653118736569&redType=1&iCPM=0&sign=448a1bf43e6a391258e509ad6c553040"; //let body="&userId=67397&timeStamp=1653118736569&redType=1&iCPM=0&sign=448a1bf43e6a391258e509ad6c553040";
let urlObject = populateUrlObject(url, body, this.USER_AGENT) let urlObject = populateUrlObject(url, body, this.USER_AGENT)

Loading…
Cancel
Save