mirror of
https://github.com/qitoqito/psyduck.git
synced 2026-01-16 15:40:42 +08:00
Compare commits
7 Commits
ca4ed949ba
...
d7678ecf35
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7678ecf35 | ||
|
|
aa77ba0a72 | ||
|
|
001c17be2f | ||
|
|
428f94b5a4 | ||
|
|
687e8d7f73 | ||
|
|
c015e02ed4 | ||
|
|
52de2020a6 |
@ -1,15 +1,22 @@
|
||||
[env]
|
||||
;curlPath= # 编译过的libressl-curl路径,默认/opt/psyduck/curl/bin/psyduck-curl
|
||||
;curlPath= # 编译过的libressl-curl路径,默认在/opt/psyduck/curl/bin/psyduck-curl
|
||||
;iniPath= # ini文件获取路径,默认config/
|
||||
;jdSign= # 京东sign接口url
|
||||
;validCookie=true|false # 缓存过期cookie,开启后,脚本识别到账户过期,将缓存存储,后续脚本运行将跳过过期账户
|
||||
;panel=qinglong|js|ini # 面板类型设置,账户cookie操作使用,使用cookie/{type}.js设置js,使用cookie/{type}.ini设置ini
|
||||
;validCookie=true|false # 缓存过期cookie,开启后,脚本识别到账户过期,将缓存账户,后续脚本运行将跳过过期账户
|
||||
;panel=qinglong|js|ini # 面板类型设置,账户cookie操作使用,使用cookie/{type}.js设置js,使用cookie/{type}.ini设置ini,使用青龙设置qinglong
|
||||
;QINGLONG_ClientId= # 青龙ClientId
|
||||
;QINGLONG_ClientSecret= # 青龙ClientSecret
|
||||
;QINGLONG_BaseUrl= # 青龙Url,一般bridge模式无需设置,host模式可能需要
|
||||
;index=true|false # true:账户下标从1开始计数 false:下标从0开始计数
|
||||
|
||||
[global]
|
||||
;test=xxxx # 脚本全局变量
|
||||
|
||||
[bot]
|
||||
;BOT_TOKEN= # Telegram Bot Token
|
||||
;BOT_ROOT= # Telegram 用户 Id
|
||||
;BOT_PROXY= # Telegram 代理
|
||||
|
||||
[proxy]
|
||||
;proxyGroup= # 静态代理池,适用长期有效ip,需要自行创建proxy.ini
|
||||
;proxyUrl= # 代理ip请求地址
|
||||
|
||||
@ -17,6 +17,7 @@ export default {
|
||||
},
|
||||
referer: "https://prodev.m.jd.com/",
|
||||
shell: true,
|
||||
token: true
|
||||
},
|
||||
'isvjcloud.com': {
|
||||
cookieJar: true,
|
||||
|
||||
210
parse/jd/jd_task_3c.js
Normal file
210
parse/jd/jd_task_3c.js
Normal file
@ -0,0 +1,210 @@
|
||||
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
|
||||
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}`)
|
||||
if (i.assignmentName.includes('邀请')) {
|
||||
isOk = 1
|
||||
}
|
||||
}
|
||||
else {
|
||||
p.log(`正在运行: ${i.assignmentName}`)
|
||||
let extraType = i.ext.extraType
|
||||
if (i.assignmentName.includes('邀请')) {
|
||||
status = 1
|
||||
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) {
|
||||
p.info.work = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,6 +21,7 @@ export class Main extends Template {
|
||||
async main(p) {
|
||||
let user = p.data.user;
|
||||
let context = p.context;
|
||||
let status
|
||||
let s = await this.curl({
|
||||
'url': `https://api.m.jd.com/MiniTask_ChannelPage?g_ty=ls&g_tk=1629788202`,
|
||||
'form': `loginType=11&clientType=wxapp&client=apple&clientVersion=9.23.200&build=&osVersion=iOS%2015.1.1&screen=390*844&networkType=wifi&d_brand=iPhone&d_model=iPhone%2012%20Pro%3CiPhone13%2C3%3E&lang=zh_CN&functionId=MiniTask_ChannelPage&t=1732259085779&body={"source":"task","businessSource":"bbxa"}&appid=hot_channel`,
|
||||
@ -70,14 +71,28 @@ export class Main extends Template {
|
||||
)
|
||||
let subCode = this.haskey(sign, 'subCode')
|
||||
if (subCode == 0) {
|
||||
status = 1
|
||||
p.msg(sign.data.toastMsg)
|
||||
}
|
||||
else if (subCode == 3010) {
|
||||
status = 1
|
||||
p.log(sign.message)
|
||||
}
|
||||
else {
|
||||
p.log(this.haskey(sign, 'message') || sign)
|
||||
}
|
||||
let sign2 = await this.curl({
|
||||
'form': `loginType=11&clientType=wxapp&client=apple&clientVersion=10.15.100&build=&osVersion=iOS%2015.1.1&screen=390*844&networkType=wifi&d_brand=iPhone&d_model=iPhone%2012%20Pro%3CiPhone13%2C3%3E&lang=zh_CN&uuid=oTGnpnBPpyvARmNaPlEeBxjJ4J_U&partner=&forcebot=&wifiBssid=&scope=&functionId=SignComponent_doSignTask&appid=hot_channel&loginWQBiz=signcomponent&body={"activityId":"10004","version":1}`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '9a38a'
|
||||
},
|
||||
referer: 'https://servicewechat.com/wx91d27dbf599dff74/793/page-frame.html'
|
||||
}
|
||||
)
|
||||
if (status) {
|
||||
p.info.work = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
168
parse/jd/jd_task_pcLottery.js
Normal file
168
parse/jd/jd_task_pcLottery.js
Normal file
@ -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<i.timesLimit; j++) {
|
||||
if (list[j].status == 1) {
|
||||
let d = await this.curl({
|
||||
'form': `functionId=pc_interact_assign_execute&body={"eaId":"${i.id}","type":${i.type},"itemId":"${list[j].itemId}","extraType":"${i.extraType}","rk":false,"actionType":1}&appid=pc_interact_center&clientVersion=1.0.0&client=pc`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '9a92f'
|
||||
},
|
||||
extend
|
||||
}
|
||||
)
|
||||
let wait = this.match(/(\d+)S/, i.desc)
|
||||
if (wait) {
|
||||
p.log(i.desc)
|
||||
await this.wait(parseInt(wait) * 1000)
|
||||
}
|
||||
let r = await this.curl({
|
||||
'form': `functionId=pc_interact_assign_execute&body={"eaId":"${i.id}","type":${i.type},"itemId":"${list[j].itemId}","extraType":"${i.extraType}","rk":false,"actionType":0}&appid=pc_interact_center&clientVersion=1.0.0&client=pc`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '9a92f'
|
||||
},
|
||||
extend
|
||||
}
|
||||
)
|
||||
if (this.haskey(r, 'data.assignmentRewardInfo')) {
|
||||
status = 1
|
||||
}
|
||||
else if (this.haskey(r, "errCode", "302")) {
|
||||
p.log("任务已完成")
|
||||
status = 1
|
||||
}
|
||||
else {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
query = await this.curl({
|
||||
'url': `https://api.m.jd.com/?appid=pc_interact_center&body={"type":0}&client=pc&clientVersion=1.0.0&functionId=pc_interact_assign_query`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '9a92f',
|
||||
type: 'wechat'
|
||||
},
|
||||
extend
|
||||
}
|
||||
)
|
||||
let data = query.data.initCompletionInfo
|
||||
let execute = await this.curl({
|
||||
'form': `functionId=pc_interact_assign_execute&body={"eaId":"${data.eaId}","type":0,"rk":false}&appid=pc_interact_center&clientVersion=1.0.0&client=pc&t=1742395117338`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '9a92f'
|
||||
},
|
||||
extend
|
||||
}
|
||||
)
|
||||
let lotteryDrawInfo = query.data.lotteryDrawInfo
|
||||
let isOk = 1
|
||||
while (true) {
|
||||
isOk = 0
|
||||
p.log("抽奖中...")
|
||||
let lottery = await this.curl({
|
||||
'form': `appid=pc_interact_center&body={"rk":${lotteryDrawInfo.rk},"eaId":"${lotteryDrawInfo.eaId}","type":${lotteryDrawInfo.type}}&client=pc&clientVersion=1.0.0&functionId=pc_interact_assign_execute`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '9a92f',
|
||||
type: 'wechat'
|
||||
},
|
||||
extend
|
||||
}
|
||||
)
|
||||
let info = this.haskey(lottery, ['data.assignmentRewardInfo'])
|
||||
if (this.haskey(lottery, 'errCode', "304")) {
|
||||
isOk = 1
|
||||
p.log("抽奖次数不足")
|
||||
break
|
||||
}
|
||||
if (!this.haskey(lottery, 'data')) {
|
||||
break
|
||||
}
|
||||
isOk = 1
|
||||
for (let j in info) {
|
||||
if (j.includes("Rewards")) {
|
||||
for (let z of info[j]) {
|
||||
if (z.rewardDesc.includes("京豆")) {
|
||||
p.award(z.rewardDesc, 'bean')
|
||||
}
|
||||
else if (z.rewardDesc == '红包') {
|
||||
p.award(z.discount, 'redpacket')
|
||||
}
|
||||
else {
|
||||
p.log(`抽奖获得: ${z.rewardDesc}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
await this.wait(1000)
|
||||
}
|
||||
if (status && isOk) {
|
||||
p.info.work = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
56
parse/jd/jd_task_plusBusiness.js
Normal file
56
parse/jd/jd_task_plusBusiness.js
Normal file
@ -0,0 +1,56 @@
|
||||
import {Template} from '../../template.js'
|
||||
|
||||
export class Main extends Template {
|
||||
constructor() {
|
||||
super()
|
||||
this.profile = {
|
||||
title: '京东PLUS天天开盲盒',
|
||||
crontab: 3,
|
||||
interval: 1000,
|
||||
headers: {
|
||||
referer: 'https://plus.m.jd.com/index?flow_system=wjhk&resourceExportId=1010225'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async prepare() {
|
||||
}
|
||||
|
||||
async main(p) {
|
||||
let user = p.data.user;
|
||||
let context = p.context;
|
||||
let s = await this.curl({
|
||||
'form': `functionId=delivery_component&body={"ubbLocId":"plus_ttmh"}&appid=plus_business&loginType=2&loginWQBiz=&scval=test07`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '124a8',
|
||||
expire: {
|
||||
"code": 401,
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
let data = this.haskey(s, 'data.compInfoList.0.data')
|
||||
if (!data) {
|
||||
if (this.haskey(s, 'data.compInfoList.0')) {
|
||||
p.info.work = true
|
||||
}
|
||||
p.err("没有获取到数据,可能不是Plus用户")
|
||||
}
|
||||
else {
|
||||
let detail = this.haskey(data, 'rightResourceDetails.0') || {}
|
||||
for (let i in detail) {
|
||||
if (detail[i] && typeof detail[i] == 'object') {
|
||||
if (i == 'hongBaoInfo') {
|
||||
p.award(detail[i].discount, 'redpacket')
|
||||
}
|
||||
else {
|
||||
p.log(detail[i].limitStr || detail[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
p.info.work = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,6 +35,7 @@ export class Main extends Template {
|
||||
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
|
||||
if (signToken) {
|
||||
let sign = await this.curl({
|
||||
'url': `https://api.m.jd.com/atop_channel_sign_in`,
|
||||
@ -77,25 +78,51 @@ export class Main extends Template {
|
||||
if (i.completionFlag) {
|
||||
status = 1
|
||||
p.log(`任务已经完成: ${i.assignmentName}`)
|
||||
if (i.assignmentName.includes('邀请')) {
|
||||
isOk = 1
|
||||
}
|
||||
}
|
||||
else {
|
||||
p.log(`正在运行: ${i.assignmentName}`)
|
||||
let extraType = i.ext.extraType
|
||||
if (i.assignmentName.includes('邀请')) {
|
||||
status = 1
|
||||
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++
|
||||
itemId = this.dict[users[this.n % users.length]]
|
||||
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_jdsupermarket","scenario":"sign","assignmentType":"${i.assignmentType}","encryptAssignmentId":"${i.encryptAssignmentId}","itemId":"${itemId}","assistFlag":true,"babelChannel":"ttt1","isJdApp":"1","isWx":"0"}`,
|
||||
user
|
||||
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}`)) {
|
||||
@ -181,22 +208,5 @@ export class Main extends Template {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getBody(params) {
|
||||
let str = "",
|
||||
map = Object.keys(params).sort(function(d, k) {
|
||||
return d.localeCompare(k);
|
||||
});
|
||||
for (let __i of map) {
|
||||
str = str.concat(params[__i]);
|
||||
}
|
||||
let t = Date.now();
|
||||
let r = "".concat("c4491f13dce9c71f").concat(str).concat(t);
|
||||
let md5 = this.md5(r)
|
||||
params.timestamp = t;
|
||||
params.sign = md5;
|
||||
params.signKey = "c4491f13dce9c71f";
|
||||
return this.dumps(params);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,6 @@ export class Main extends Template {
|
||||
'user-agent': 'wechat',
|
||||
'referer': 'https://h5.m.jd.com/wq/dev/RFz7fuh1jc5mfj4speLLRjb1pEQ/index.html'
|
||||
},
|
||||
turn: 2,
|
||||
delay: 500
|
||||
}
|
||||
}
|
||||
@ -18,144 +17,87 @@ export class Main extends Template {
|
||||
async main(p) {
|
||||
let user = p.data.user;
|
||||
let context = p.context;
|
||||
if (this.turnCount == 0) {
|
||||
let status = 1
|
||||
let signList = await this.curl({
|
||||
'url': `https://api.m.jd.com/miniTask_queryFarmSignList?g_ty=ls&g_tk=1084416199`,
|
||||
'form': `loginType=2&clientType=wxapp&client=apple&clientVersion=10.14.110&build=&osVersion=iOS%2015.1.1&screen=390*844&networkType=wifi&d_brand=iPhone&d_model=iPhone%2012%20Pro%3CiPhone13%2C3%3E&lang=zh_CN&uuid=oCwKwuBoW0okKEIIDlT5FXxscxcM&functionId=miniTask_queryFarmSignList&t=1739944985868&body={}&appid=hot_channel`,
|
||||
let st = 1
|
||||
let signList = await this.curl({
|
||||
'url': `https://api.m.jd.com/miniTask_queryFarmSignList?g_ty=ls&g_tk=1084416199`,
|
||||
'form': `loginType=2&clientType=wxapp&client=apple&clientVersion=10.14.110&build=&osVersion=iOS%2015.1.1&screen=390*844&networkType=wifi&d_brand=iPhone&d_model=iPhone%2012%20Pro%3CiPhone13%2C3%3E&lang=zh_CN&uuid=oCwKwuBoW0okKEIIDlT5FXxscxcM&functionId=miniTask_queryFarmSignList&t=1739944985868&body={}&appid=hot_channel`,
|
||||
user,
|
||||
referer: 'https://servicewechat.com/wx91d27dbf599dff74/787/page-frame.html',
|
||||
}
|
||||
)
|
||||
let subCode = this.haskey(signList, 'subCode')
|
||||
if (subCode == 109) {
|
||||
p.log('活动太火爆了,请稍后再试')
|
||||
st = 0
|
||||
}
|
||||
if (!signList) {
|
||||
p.err("没获取到数据...")
|
||||
st = 0
|
||||
}
|
||||
if (this.haskey(signList, 'data.currentSignStatus', 1)) {
|
||||
p.log("已签到..")
|
||||
}
|
||||
else {
|
||||
status = 0
|
||||
let sign = await this.curl({
|
||||
'url': `https://api.m.jd.com/miniTask_doFarmSign?g_ty=ls&g_tk=1084416199`,
|
||||
'form': `loginType=2&clientType=wxapp&client=apple&clientVersion=10.14.110&build=&osVersion=iOS%2015.1.1&screen=390*844&networkType=wifi&d_brand=iPhone&d_model=iPhone%2012%20Pro%3CiPhone13%2C3%3E&lang=zh_CN&uuid=oCwKwuBoW0okKEIIDlT5FXxscxcM&functionId=miniTask_doFarmSign&t=1739945007901&body={}&appid=hot_channel`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '3f5a6'
|
||||
},
|
||||
referer: 'https://servicewechat.com/wx91d27dbf599dff74/787/page-frame.html',
|
||||
}
|
||||
)
|
||||
let subCode = this.haskey(signList, 'subCode')
|
||||
if (subCode == 109) {
|
||||
p.info.jump = true
|
||||
p.log('活动太火爆了,请稍后再试')
|
||||
return
|
||||
}
|
||||
if (!signList) {
|
||||
p.err("没获取到数据...")
|
||||
return
|
||||
}
|
||||
if (this.haskey(signList, 'data.currentSignStatus', 1)) {
|
||||
p.log("已签到..")
|
||||
}
|
||||
else {
|
||||
status = 0
|
||||
let sign = await this.curl({
|
||||
'url': `https://api.m.jd.com/miniTask_doFarmSign?g_ty=ls&g_tk=1084416199`,
|
||||
'form': `loginType=2&clientType=wxapp&client=apple&clientVersion=10.14.110&build=&osVersion=iOS%2015.1.1&screen=390*844&networkType=wifi&d_brand=iPhone&d_model=iPhone%2012%20Pro%3CiPhone13%2C3%3E&lang=zh_CN&uuid=oCwKwuBoW0okKEIIDlT5FXxscxcM&functionId=miniTask_doFarmSign&t=1739945007901&body={}&appid=hot_channel`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '3f5a6'
|
||||
},
|
||||
referer: 'https://servicewechat.com/wx91d27dbf599dff74/787/page-frame.html',
|
||||
}
|
||||
)
|
||||
if (this.haskey(sign, 'data.signStatus')) {
|
||||
p.log(`签到成功: 获得水滴: ${sign.data.awardNum}`)
|
||||
status = 1
|
||||
}
|
||||
}
|
||||
if (status) {
|
||||
p.info.work = true
|
||||
if (this.haskey(sign, 'data.signStatus')) {
|
||||
p.log(`签到成功: 获得水滴: ${sign.data.awardNum}`)
|
||||
status = 1
|
||||
}
|
||||
}
|
||||
else if (this.turnCount == 1) {
|
||||
let taskList = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739972758582&body={"version":9,"channelParam":"2","channel":0,"pushSwitch":false,"showSubscribe":false,"babelChannel":"ttt1"}&functionId=farm_task_list`,
|
||||
user
|
||||
}
|
||||
)
|
||||
let list = this.haskey(taskList, 'data.result.taskList')
|
||||
if (!list) {
|
||||
p.err("没有获取到任务列表...")
|
||||
return
|
||||
let taskList = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739972758582&body={"version":9,"channelParam":"2","channel":0,"pushSwitch":false,"showSubscribe":false,"babelChannel":"ttt1"}&functionId=farm_task_list`,
|
||||
user
|
||||
}
|
||||
let status = 1
|
||||
for (let i of list) {
|
||||
if (i.mainTitle.includes("下单")) {
|
||||
}
|
||||
else if (i.mainTitle.includes("进入")) {
|
||||
}
|
||||
else if (i.taskDoTimes != i.taskLimitTimes) {
|
||||
p.log("正在运行:", i.mainTitle)
|
||||
if (i.mainTitle.includes("浇水")) {
|
||||
if (i.taskDoTimes != i.taskLimitTimes) {
|
||||
status = 0
|
||||
for (let j of Array(Math.ceil((i.taskLimitTimes - i.taskDoTimes) / 4))) {
|
||||
let water = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739982505593&body={"version":9,"channelParam":"2","waterType":2,"babelChannel":"ttt1"}&functionId=farm_water`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '28981'
|
||||
}
|
||||
}
|
||||
)
|
||||
if (this.haskey(water, 'data.result.bottleWater')) {
|
||||
status = 1
|
||||
p.log("浇水成功....")
|
||||
}
|
||||
else {
|
||||
status = 0
|
||||
p.log("浇水失败...")
|
||||
break
|
||||
}
|
||||
await this.wait(1000)
|
||||
}
|
||||
if (status) {
|
||||
let award = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739981615997&body={"version":9,"channelParam":"2","taskType":"${i.taskType}","taskId":${i.taskId},"channel":0}&functionId=farm_task_receive_award`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '33e0f'
|
||||
}
|
||||
}
|
||||
)
|
||||
if (this.haskey(award, 'data.result.taskAward')) {
|
||||
p.log(award.data.result.taskAward)
|
||||
}
|
||||
else {
|
||||
p.log("领取奖励失败", award)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (i.taskSourceUrl) {
|
||||
var doTask = await this.curl({
|
||||
)
|
||||
let list = this.haskey(taskList, 'data.result.taskList')
|
||||
if (!list) {
|
||||
p.err("没有获取到任务列表...")
|
||||
return
|
||||
}
|
||||
let status = 1
|
||||
for (let i of list) {
|
||||
if (i.mainTitle.includes("下单")) {
|
||||
}
|
||||
else if (i.mainTitle.includes("进入")) {
|
||||
}
|
||||
else if (i.taskDoTimes != i.taskLimitTimes) {
|
||||
p.log("正在运行:", i.mainTitle)
|
||||
if (i.mainTitle.includes("浇水")) {
|
||||
if (i.taskDoTimes != i.taskLimitTimes) {
|
||||
status = 0
|
||||
for (let j of Array(Math.ceil((i.taskLimitTimes - i.taskDoTimes) / 4))) {
|
||||
let water = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739973082105&body={"version":9,"channelParam":"2","taskType":"${i.taskType}","taskId":${i.taskId},"taskInsert":false,"itemId":"${new Buffer.from(i.taskSourceUrl, 'utf-8').toString('base64')}","channel":0}&functionId=farm_do_task`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739982505593&body={"version":9,"channelParam":"2","waterType":2,"babelChannel":"ttt1"}&functionId=farm_water`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '28981'
|
||||
}
|
||||
}
|
||||
)
|
||||
if (this.haskey(water, 'data.result.bottleWater')) {
|
||||
status = 1
|
||||
p.log("浇水成功....")
|
||||
}
|
||||
else {
|
||||
status = 0
|
||||
p.log("浇水失败...")
|
||||
break
|
||||
}
|
||||
await this.wait(1000)
|
||||
}
|
||||
else if (i.pipeExt) {
|
||||
let detail = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739978261715&body={"version":9,"channelParam":"2","taskType":"${i.taskType}","taskId":${i.taskId},"channel":0}&functionId=farm_task_detail`,
|
||||
user
|
||||
}
|
||||
)
|
||||
var doTask = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739978263580&body={"version":9,"channelParam":"2","taskType":"${i.taskType}","taskId":${i.taskId},"taskInsert":false,"itemId":"${new Buffer.from(this.haskey(detail, 'data.result.taskDetaiList.0.itemId'), 'utf-8').toString('base64')}","channel":0}&functionId=farm_do_task`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '28981'
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
if (this.haskey(doTask, 'data.success')) {
|
||||
p.log("任务完成...")
|
||||
status = 1
|
||||
if (status) {
|
||||
let award = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739981615997&body={"version":9,"channelParam":"2","taskType":"${i.taskType}","taskId":${i.taskId},"channel":0}&functionId=farm_task_receive_award`,
|
||||
@ -172,39 +114,88 @@ export class Main extends Template {
|
||||
p.log("领取奖励失败", award)
|
||||
}
|
||||
}
|
||||
else {
|
||||
status = 0
|
||||
p.log("任务失败", doTask)
|
||||
}
|
||||
await this.wait(1000)
|
||||
}
|
||||
}
|
||||
else if (i.taskStatus == 2) {
|
||||
let award = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739981615997&body={"version":9,"channelParam":"2","taskType":"${i.taskType}","taskId":${i.taskId},"channel":0}&functionId=farm_task_receive_award`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '33e0f'
|
||||
}
|
||||
}
|
||||
)
|
||||
if (this.haskey(award, 'data.result.taskAward')) {
|
||||
p.log(award.data.result.taskAward)
|
||||
status = 1
|
||||
}
|
||||
else {
|
||||
p.log("领取奖励失败", award)
|
||||
status = 0
|
||||
}
|
||||
}
|
||||
else {
|
||||
p.log("任务已完成:", i.mainTitle)
|
||||
if (i.taskSourceUrl) {
|
||||
var doTask = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739973082105&body={"version":9,"channelParam":"2","taskType":"${i.taskType}","taskId":${i.taskId},"taskInsert":false,"itemId":"${new Buffer.from(i.taskSourceUrl, 'utf-8').toString('base64')}","channel":0}&functionId=farm_do_task`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '28981'
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
else if (i.pipeExt) {
|
||||
let detail = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739978261715&body={"version":9,"channelParam":"2","taskType":"${i.taskType}","taskId":${i.taskId},"channel":0}&functionId=farm_task_detail`,
|
||||
user
|
||||
}
|
||||
)
|
||||
var doTask = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739978263580&body={"version":9,"channelParam":"2","taskType":"${i.taskType}","taskId":${i.taskId},"taskInsert":false,"itemId":"${new Buffer.from(this.haskey(detail, 'data.result.taskDetaiList.0.itemId'), 'utf-8').toString('base64')}","channel":0}&functionId=farm_do_task`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '28981'
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
if (this.haskey(doTask, 'data.success')) {
|
||||
p.log("任务完成...")
|
||||
status = 1
|
||||
let award = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739981615997&body={"version":9,"channelParam":"2","taskType":"${i.taskType}","taskId":${i.taskId},"channel":0}&functionId=farm_task_receive_award`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '33e0f'
|
||||
}
|
||||
}
|
||||
)
|
||||
if (this.haskey(award, 'data.result.taskAward')) {
|
||||
p.log(award.data.result.taskAward)
|
||||
}
|
||||
else {
|
||||
p.log("领取奖励失败", award)
|
||||
}
|
||||
}
|
||||
else {
|
||||
status = 0
|
||||
p.log("任务失败", doTask)
|
||||
}
|
||||
await this.wait(1000)
|
||||
}
|
||||
}
|
||||
if (status) {
|
||||
p.info.work = true
|
||||
else if (i.taskStatus == 2) {
|
||||
let award = await this.curl({
|
||||
'url': `https://api.m.jd.com/client.action`,
|
||||
'form': `appid=signed_farm_mp&client=&clientVersion=1.0.0&screen=390*812&wqDefault=false&loginType=2&t=1739981615997&body={"version":9,"channelParam":"2","taskType":"${i.taskType}","taskId":${i.taskId},"channel":0}&functionId=farm_task_receive_award`,
|
||||
user,
|
||||
algo: {
|
||||
appId: '33e0f'
|
||||
}
|
||||
}
|
||||
)
|
||||
if (this.haskey(award, 'data.result.taskAward')) {
|
||||
p.log(award.data.result.taskAward)
|
||||
status = 1
|
||||
}
|
||||
else {
|
||||
p.log("领取奖励失败", award)
|
||||
status = 0
|
||||
}
|
||||
}
|
||||
else {
|
||||
p.log("任务已完成:", i.mainTitle)
|
||||
}
|
||||
}
|
||||
if (status && st) {
|
||||
p.info.work = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -11,7 +11,9 @@ export class Message {
|
||||
async send(msgAry) {
|
||||
const result = this.splitArrays(this.msgAry);
|
||||
for (let message of result) {
|
||||
message.push([`PsyDuck [https://github.com/qitoqito/psyduck]`])
|
||||
if (!this.func.message.notice) {
|
||||
message.push([`PsyDuck [https://github.com/qitoqito/psyduck]`])
|
||||
}
|
||||
this.message = message
|
||||
if (this.msg.hasOwnProperty('TELEGRAM_TOKEN')) {
|
||||
await this.tgNotify()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user