From 52de2020a69fc43006b7af61f65b39d4de289a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AF=E8=BE=BE=E9=B8=AD?= Date: Thu, 20 Mar 2025 12:59:27 +0800 Subject: [PATCH] . --- parse/jd/jd_task_3c.js | 206 ++++++++++++++++++++++ parse/jd/jd_task_pcLottery.js | 168 ++++++++++++++++++ parse/jd/jd_task_plusBusiness.js | 56 ++++++ parse/jd/jd_task_superMarket.js | 48 ++--- parse/jd/jd_task_wxFarm.js | 293 +++++++++++++++---------------- 5 files changed, 599 insertions(+), 172 deletions(-) create mode 100644 parse/jd/jd_task_3c.js create mode 100644 parse/jd/jd_task_pcLottery.js create mode 100644 parse/jd/jd_task_plusBusiness.js diff --git a/parse/jd/jd_task_3c.js b/parse/jd/jd_task_3c.js new file mode 100644 index 0000000..b95c5da --- /dev/null +++ b/parse/jd/jd_task_3c.js @@ -0,0 +1,206 @@ +import {Template} from '../../template.js' + +export class Main extends Template { + constructor() { + super() + this.profile = { + title: '京东3C数码', + crontab: 4, + help: 'main' + } + } + + async prepare() { + this.shareCode({ + id: '4SWjnZSCTHPYjE5T7j35rxxuMTb6' + }) + for (let user of this.help) { + let itemId = await this.getTemp(user) + if (itemId) { + this.dict[user] = itemId + } + } + } + + async main(p) { + let user = p.data.user; + let context = p.context; + if (this.turnCount == 0) { + var html = await this.curl({ + 'url': `https://pro.m.jd.com/mall/active/${context.id}/index.html?stath=20&navh=44&babelChannel=ttt1&tttparams=zZ1qguleyJnTGF0IjozOS45NjEwNTQsInVuX2FyZWEiOiIxXzI4MDBfNTU4MzhfMCIsImRMYXQiOiIiLCJwcnN0YXRlIjoiMCIsImFkZHJlc3NJZCI6IjUzODg3NDg3NyIsImxhdCI6IiIsInBvc0xhdCI6MzkuOTYxMDU0LCJwb3NMbmciOjExNi4zMjIwNjEsImdwc19hcmVhIjoiMF8wXzBfMCIsImxuZyI6IiIsInVlbXBzIjoiMC0wLTAiLCJnTG5nIjoxMTYuMzIyMDYxLCJtb2RlbCI6ImlQaG9uZTEzLDMiLCJkTG5nIjoiIn70=`, + user, + referer: 'https://pro.m.jd.com/mall/active/3nh7HzSjYemGqAHSbktTrf8rrH8M/index.html' + } + ) + let react = this.jsonParse(this.match([/__react_data__\s*=\s*(.*?)\s*;\n+/,], html)) + let signToken = this.match(/"signToken"\s*:\s*"(\w+)"/, html) + let status = 0 + let isOk = 0 + if (signToken) { + let sign = await this.curl({ + 'url': `https://api.m.jd.com/atop_channel_sign_in`, + 'form': `appid=jd-super-market&t=1713230766545&functionId=atop_channel_sign_in&client=m&uuid=de21c6604748f97dd3977153e51a47f4efdb9a47&body={"signToken":"${signToken}","channelFollowStatus":1,"bizCode":"cn_retail_3c_digital","scenario":"sign","babelChannel":"ttt1","isJdApp":"1","isWx":"0"}`, + user, + algo: { + appId: 'b8fc7' + } + } + ) + if (this.haskey(sign, 'success')) { + status = 1 + p.log(`签到成功`) + for (let i of sign.data.rewards) { + p.log(`获得: ${i.rewardDesc}`) + } + } + else if (this.haskey(sign, "code", "14013")) { + p.log(`您今天已经签过到了`) + status = 1 + } + else { + p.log(this.haskey(sign, 'message') || sign) + } + } + var data = {} + if (this.haskey(react, 'activityData.floorList')) { + data = react.activityData + } + for (let ii in data) { + if (ii == 'floorList') { + for (let jj of data[ii]) { + if (jj.providerData && this.haskey(jj, 'providerData.data.floorData.name') == '汪贝任务楼层') { + let floor = jj.providerData.data.floorData + for (let i of floor.items) { + status = 0 + if (i.completionFlag) { + status = 1 + p.log(`任务已经完成: ${i.assignmentName}`) + } + else { + p.log(`正在运行: ${i.assignmentName}`) + let extraType = i.ext.extraType + if (i.assignmentName.includes('邀请')) { + isOk = 0 + if (this.haskey(i, 'ext.assistTaskDetail.itemId')) { + await this.setTemp(user, i.ext.assistTaskDetail.itemId, 86400000) + } + let users = Object.keys(this.dict) + if (users) { + let itemId = '' + let u = users[this.n % users.length] + this.n++ + if (u == user) { + u = users[this.n % users.length] + } + itemId = this.dict[u] + let help = await this.curl({ + 'form': `appid=jd-super-market&t=1742122986378&functionId=atop_channel_complete_task&client=m&body={"bizCode":"cn_retail_3c_digital","scenario":"sign","assignmentType":"${i.assignmentType}","encryptAssignmentId":"${i.encryptAssignmentId}","itemId":"${itemId}","assistFlag":true,"babelChannel":"ttt1","isJdApp":"1","isWx":"0"}`, + user, + algo: { + appId: '51113' + } + } + ) + let subCode = this.haskey(help, 'data.subCode') + if (subCode == '104') { + p.log("您已经助力过了") + isOk = 1 + } + else if (subCode == '0') { + p.log("助力成功") + isOk = 1 + } + if (subCode == '109') { + p.log("不能自己给自己助力") + } + } + else { + isOk = 1 + } + } + else if (this.haskey(i, `ext.${i.ext.extraType}`)) { + let extra = i.ext[extraType] + try { + for (let j of extra.slice(0, i.assignmentTimesLimit)) { + if (['shoppingActivity', 'productsInfo', 'browseShop'].includes(extraType)) { + let d = await this.curl({ + 'url': `https://api.m.jd.com/client.action`, + 'form': `appid=jd-super-market&body=${this.dumps( + { + "bizCode": "cn_retail_3c_digital", + "scenario": "sign", + "assignmentType": i.assignmentType, + "encryptAssignmentId": i.encryptAssignmentId, + "itemId": j.itemId || j.advId, + "actionType": 1, + "babelChannel": "ttt1", + "isJdApp": "0", + "isWx": "0" + } + )}&sign=11&t=1653132222710&client=m&functionId=atop_channel_complete_task`, + user, + algo: { + appId: '51113' + }, + // ciphers: 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384' + } + ) + p.log(this.haskey(d, 'data.msg') || this.haskey(d, 'message')) + await this.wait((i.ext.waitDuration || 0) * 1000 + 500) + } + let s = await this.curl({ + 'url': `https://api.m.jd.com/client.action`, + 'form': `appid=jd-super-market&body=${this.dumps( + { + "bizCode": "cn_retail_3c_digital", + "scenario": "sign", + "assignmentType": i.assignmentType, + "encryptAssignmentId": i.encryptAssignmentId, + "itemId": j.itemId || j.advId, + "babelChannel": "ttt1", + "isJdApp": "0", + "isWx": "0" + } + )}&sign=11&t=1653132222710&client=m&functionId=atop_channel_complete_task`, + user, algo: { + appId: '51113' + }, + // ciphers: 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384' + } + ) + p.log(i.assignmentName, this.haskey(s, 'data.msg') || this.haskey(s, 'message')) + if (this.haskey(s, 'message', '风险等级未通过')) { + return + } + if (this.haskey(s, 'message', '活动太火爆了')) { + break + } + if (this.haskey(s, 'data.doTaskRewardsInfo.successRewards')) { + for (let kkk in s.data.doTaskRewardsInfo.successRewards) { + for (let kkkk of s.data.doTaskRewardsInfo.successRewards[kkk]) { + p.log(`获得:`, kkkk.quantity, kkkk.rewardName) + } + } + status = 1 + } + await this.wait(1000) + } + } catch (e) { + p.log(e) + } + } + else { + } + } + } + } + } + } + } + if (status && isOk) { + p.info.work = true + } + } + } +} + diff --git a/parse/jd/jd_task_pcLottery.js b/parse/jd/jd_task_pcLottery.js new file mode 100644 index 0000000..e420269 --- /dev/null +++ b/parse/jd/jd_task_pcLottery.js @@ -0,0 +1,168 @@ +import {Template} from '../../template.js' + +export class Main extends Template { + constructor() { + super() + this.profile = { + title: '京东网页天天抽奖', + crontab: 3, + headers: { + referer: 'https://bean.jd.com/myJingBean/list', + 'user-agent': "Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/" + 59 + Math.round(Math.random() * 10) + ".0.3497." + Math.round(Math.random() * 100) + "Safari/537.36", + }, + interval: 2000 + } + } + + async prepare() { + } + + async main(p) { + let user = p.data.user; + let context = p.context; + let status = 0 + let extend = `uuid=${this.uuid(22, 'n')}&area=16_${this.rand(1000, 1300)}_${this.rand(1000, 1300)}_${this.rand(1, 19)}&loginType=2&t=${new Date().getTime()}` + let query = await this.curl({ + 'url': `https://api.m.jd.com/?appid=pc_interact_center&body={"type":1}&client=pc&clientVersion=1.0.0&functionId=pc_interact_assign_query`, + user, + algo: { + appId: '9a92f', + expire: { + "code": "3" + } + }, + extend + } + ) + for (let i of this.haskey(query, 'data.assignmentInfoList')) { + if (i.completionCnt == i.timesLimit) { + p.log("任务已完成:", i.name) + status = 1 + } + else if (i.extraType == 'order') { + } + else { + if (i.extraType == 'sign') { + let execute = await this.curl({ + 'form': `functionId=pc_interact_assign_execute&body={"eaId":"TLBebEJwk4ADHLtRfDsRcV4UvS1","type":5,"itemId":"1","extraType":"sign","rk":false,"actionType":1}&appid=pc_interact_center&clientVersion=1.0.0&client=pc`, + user, + algo: { + appId: '9a92f' + }, + extend + } + ) + } + else { + p.log("正在浏览:", i.name) + // console.log(i) + status = 0 + let list = i[Object.keys(i).filter(d => (typeof i[d] == 'object' && d != 'rewards'))[0]] + for (let j = 0; j