mirror of
https://github.com/qitoqito/psyduck.git
synced 2026-01-12 12:40:44 +08:00
支持curlPath路径设置
This commit is contained in:
parent
318da27233
commit
8d15e7047a
@ -1,4 +1,5 @@
|
|||||||
[env]
|
[env]
|
||||||
|
;curlPath= # 编译过的libressl-curl路径,默认/opt/psyduck/curl/bin/psyduck-curl
|
||||||
;iniPath= # ini文件获取路径,默认config/
|
;iniPath= # ini文件获取路径,默认config/
|
||||||
;jdSign= # 京东sign接口url
|
;jdSign= # 京东sign接口url
|
||||||
;validCookie=true|false # 缓存过期cookie,开启后,脚本识别到账户过期,将缓存存储,后续脚本运行将跳过过期账户
|
;validCookie=true|false # 缓存过期cookie,开启后,脚本识别到账户过期,将缓存存储,后续脚本运行将跳过过期账户
|
||||||
|
|||||||
@ -30,6 +30,9 @@ export default {
|
|||||||
},
|
},
|
||||||
'u.jd.com': {
|
'u.jd.com': {
|
||||||
shell: true
|
shell: true
|
||||||
|
},
|
||||||
|
'p.m.jd.com': {
|
||||||
|
shell: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
referer: "https://prodev.m.jd.com/",
|
referer: "https://prodev.m.jd.com/",
|
||||||
|
|||||||
@ -6,14 +6,16 @@ export class Main extends Template {
|
|||||||
this.profile = {
|
this.profile = {
|
||||||
title: "京东天天领豆",
|
title: "京东天天领豆",
|
||||||
crontab: 4,
|
crontab: 4,
|
||||||
model: 'user',
|
|
||||||
sync: 1,
|
sync: 1,
|
||||||
prompt: {
|
prompt: {
|
||||||
activityId: '活动id1|id2'
|
activityId: '活动id1|id2'
|
||||||
},
|
},
|
||||||
delay: 800,
|
delay: 800,
|
||||||
interval: 2000,
|
interval: 2000,
|
||||||
verify: 1
|
verify: 1,
|
||||||
|
headers: {
|
||||||
|
referer: 'https://pro.m.jd.com/mall/active/2dFZxAZeNGpViWwEb5P9J1SE8e2q/index.html'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,61 +25,86 @@ export class Main extends Template {
|
|||||||
|
|
||||||
async main(p) {
|
async main(p) {
|
||||||
let user = p.data.user
|
let user = p.data.user
|
||||||
let home = await this.curl({
|
let context = p.context
|
||||||
'url': `https://api.m.jd.com/`,
|
let sign = await this.curl({
|
||||||
'form': `functionId=deliverySign_home&appid=signed_wh5_ihub&body={"activityId":"${p.context.activityId}"}&client=apple&clientVersion=13.2.8&d_model=&osVersion=15.1.1`,
|
'url': `https://api.m.jd.com/api`,
|
||||||
|
'form': `functionId=bean_deliverySign_sign&appid=signed_wh5_ihub&body={"activityId":"${context.activityId}"}&rfs=0000&client=apple&uuid=&build=169743&clientVersion=15.0.25&d_model=&osVersion=15.1.1`,
|
||||||
user,
|
user,
|
||||||
algo: {
|
algo: {
|
||||||
|
expire: {
|
||||||
|
'data.bizCode': -102
|
||||||
|
},
|
||||||
appId: 'e88fd'
|
appId: 'e88fd'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if (this.haskey(home, 'data.bizCode', -102)) {
|
let bizCode = this.haskey(sign, 'data.bizCode')
|
||||||
p.info.jump = true
|
if (this.haskey(sign, 'data.result.value')) {
|
||||||
|
p.info.work = true
|
||||||
|
p.msg(`京豆: ${sign.data.result.value}`)
|
||||||
}
|
}
|
||||||
if (this.haskey(home, 'data.result.bubbleList')) {
|
else if (bizCode == -2002) {
|
||||||
for (let i of home.data.result.bubbleList) {
|
p.info.work = true
|
||||||
if (i.status == 1) {
|
p.log("您已经签到过了")
|
||||||
let sign = await this.curl({
|
|
||||||
'url': `https://api.m.jd.com/`,
|
|
||||||
'form': `functionId=deliverySign_sign&appid=signed_wh5_ihub&body={"activityId":"${p.context.activityId}"}&client=apple&clientVersion=13.2.8&d_model=&osVersion=15.1.1`,
|
|
||||||
user,
|
|
||||||
algo: {
|
|
||||||
appId: 'e88fd'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
if (this.haskey(sign, 'data.result.value')) {
|
|
||||||
p.msg(`京豆: ${sign.data.result.value}`)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
p.log(this.haskey(sign, 'data.bizMsg') || sign)
|
|
||||||
}
|
|
||||||
let reward = await this.curl({
|
|
||||||
'url': `https://api.m.jd.com/`,
|
|
||||||
'form': `functionId=deliverySign_continue_award&appid=signed_wh5_ihub&body={"activityId":"${p.context.activityId}"}&client=apple&uuid=674ce0d97511f5ed054c3dc0af093b3b245ab68d&clientVersion=13.2.8&d_model=&osVersion=15.1.1`,
|
|
||||||
user,
|
|
||||||
algo: {
|
|
||||||
appId: 'e88fd'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
if (this.haskey(reward, 'data.result.value')) {
|
|
||||||
p.msg(`京豆: ${reward.data.result.value}`)
|
|
||||||
p.info.work = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (this.haskey(i, 'status', 2)) {
|
|
||||||
p.info.work = true
|
|
||||||
}
|
|
||||||
p.log("暂不可做:", i.text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p.log("没有获取到数据...")
|
p.log(sign)
|
||||||
}
|
}
|
||||||
|
// let home = await this.curl({
|
||||||
|
// 'url': `https://api.m.jd.com/`,
|
||||||
|
// 'form': `functionId=deliverySign_home&appid=signed_wh5_ihub&body={"activityId":"${p.context.activityId}"}&client=apple&clientVersion=13.2.8&d_model=&osVersion=15.1.1`,
|
||||||
|
// user,
|
||||||
|
// algo: {
|
||||||
|
// appId: 'e88fd'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// if (this.haskey(home, 'data.bizCode', -102)) {
|
||||||
|
// p.info.jump = true
|
||||||
|
// }
|
||||||
|
// if (this.haskey(home, 'data.result.bubbleList')) {
|
||||||
|
// for (let i of home.data.result.bubbleList) {
|
||||||
|
// if (i.status == 1) {
|
||||||
|
// let sign = await this.curl({
|
||||||
|
// 'url': `https://api.m.jd.com/`,
|
||||||
|
// 'form': `functionId=deliverySign_sign&appid=signed_wh5_ihub&body={"activityId":"${p.context.activityId}"}&client=apple&clientVersion=13.2.8&d_model=&osVersion=15.1.1`,
|
||||||
|
// user,
|
||||||
|
// algo: {
|
||||||
|
// appId: 'e88fd'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// if (this.haskey(sign, 'data.result.value')) {
|
||||||
|
// p.msg(`京豆: ${sign.data.result.value}`)
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// p.log(this.haskey(sign, 'data.bizMsg') || sign)
|
||||||
|
// }
|
||||||
|
// let reward = await this.curl({
|
||||||
|
// 'url': `https://api.m.jd.com/`,
|
||||||
|
// 'form': `functionId=deliverySign_continue_award&appid=signed_wh5_ihub&body={"activityId":"${p.context.activityId}"}&client=apple&uuid=674ce0d97511f5ed054c3dc0af093b3b245ab68d&clientVersion=13.2.8&d_model=&osVersion=15.1.1`,
|
||||||
|
// user,
|
||||||
|
// algo: {
|
||||||
|
// appId: 'e88fd'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// if (this.haskey(reward, 'data.result.value')) {
|
||||||
|
// p.msg(`京豆: ${reward.data.result.value}`)
|
||||||
|
// p.info.work = true
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// if (this.haskey(i, 'status', 2)) {
|
||||||
|
// p.info.work = true
|
||||||
|
// }
|
||||||
|
// p.log("暂不可做:", i.text)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// p.log("没有获取到数据...")
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,11 @@ export class Main extends Template {
|
|||||||
tempExpire: 3 * 86400,
|
tempExpire: 3 * 86400,
|
||||||
prompt: {
|
prompt: {
|
||||||
id: "活动Id #url里的那部分id,暂只支持部分类型"
|
id: "活动Id #url里的那部分id,暂只支持部分类型"
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'x-rp-client': "h5_1.0.0",
|
||||||
|
'request-from': 'native',
|
||||||
|
referer: 'https://h5.m.jd.com/pb/015686010/Bc9WX7MpCW7nW9QjZ5N3fFeJXMH/index.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -35,7 +40,7 @@ export class Main extends Template {
|
|||||||
if (html.includes('lottery-machine')) {
|
if (html.includes('lottery-machine')) {
|
||||||
for (let linkId of lids) {
|
for (let linkId of lids) {
|
||||||
let lottery = await this.curl({
|
let lottery = await this.curl({
|
||||||
'url': `http://api.m.jd.com/api`,
|
'url': `https://api.m.jd.com/api`,
|
||||||
'form': `functionId=lotteryMachineHome&body={"linkId":"${linkId}","taskId":"","inviter":""}&t=1713449252402&appid=activities_platform&client=ios&clientVersion=15.1.1&uuid=de21c6604748f97dd3977153e51a47f4efdb9a47&build=168960&screen=390*844&networkType=wifi&d_brand=iPhone&d_model=iPhone13%2C3&lang=zh_CN&osVersion=15.1.1&partner=-1&cthr=1`,
|
'form': `functionId=lotteryMachineHome&body={"linkId":"${linkId}","taskId":"","inviter":""}&t=1713449252402&appid=activities_platform&client=ios&clientVersion=15.1.1&uuid=de21c6604748f97dd3977153e51a47f4efdb9a47&build=168960&screen=390*844&networkType=wifi&d_brand=iPhone&d_model=iPhone13%2C3&lang=zh_CN&osVersion=15.1.1&partner=-1&cthr=1`,
|
||||||
delay: 1,
|
delay: 1,
|
||||||
algo: {
|
algo: {
|
||||||
@ -52,7 +57,7 @@ export class Main extends Template {
|
|||||||
else if (js.includes('inviteFission')) {
|
else if (js.includes('inviteFission')) {
|
||||||
for (let linkId of lids) {
|
for (let linkId of lids) {
|
||||||
let pl = await this.curl({
|
let pl = await this.curl({
|
||||||
'url': `http://api.m.jd.com/api`,
|
'url': `https://api.m.jd.com/api`,
|
||||||
form: `appid=activities_platform&body={"linkId":"${linkId}","taskId":"","inviter":""}&client=ios&clientVersion=12.3.4&functionId=inviteFissionBeforeHome&t=1718017177605&osVersion=16.2.1&build=169143&rfs=0000`,
|
form: `appid=activities_platform&body={"linkId":"${linkId}","taskId":"","inviter":""}&client=ios&clientVersion=12.3.4&functionId=inviteFissionBeforeHome&t=1718017177605&osVersion=16.2.1&build=169143&rfs=0000`,
|
||||||
algo: {
|
algo: {
|
||||||
appId: '02f8d'
|
appId: '02f8d'
|
||||||
@ -69,7 +74,7 @@ export class Main extends Template {
|
|||||||
else if (js.includes('superLeague')) {
|
else if (js.includes('superLeague')) {
|
||||||
for (let linkId of lids) {
|
for (let linkId of lids) {
|
||||||
let pl = await this.curl({
|
let pl = await this.curl({
|
||||||
'url': `http://api.m.jd.com/api`,
|
'url': `https://api.m.jd.com/api`,
|
||||||
form: `appid=activities_platform&body={"linkId":"${linkId}","taskId":"","inviter":""}&client=ios&clientVersion=12.3.4&functionId=superLeagueHome&t=1718017177605&osVersion=16.2.1&build=169143&rfs=0000`,
|
form: `appid=activities_platform&body={"linkId":"${linkId}","taskId":"","inviter":""}&client=ios&clientVersion=12.3.4&functionId=superLeagueHome&t=1718017177605&osVersion=16.2.1&build=169143&rfs=0000`,
|
||||||
algo: {
|
algo: {
|
||||||
appId: 'b7d17'
|
appId: 'b7d17'
|
||||||
@ -375,12 +380,16 @@ export class Main extends Template {
|
|||||||
let context = p.context;
|
let context = p.context;
|
||||||
let doIt = await this.doTask(p)
|
let doIt = await this.doTask(p)
|
||||||
let home = await this.curl({
|
let home = await this.curl({
|
||||||
'url': `http://api.m.jd.com/api`,
|
'url': `https://api.m.jd.com/api`,
|
||||||
'form': `functionId=wheelsHome&body={"linkId":"${context.linkId}","inviteActId":"","inviterEncryptPin":"","inviteCode":""}&t=1739590571889&appid=activities_platform&client=ios&clientVersion=15.0.15&cthr=1&loginType=&loginWQBiz=wegame`,
|
'form': `functionId=wheelsHome&body={"linkId":"${context.linkId}","inviteActId":"","inviterEncryptPin":"","inviteCode":""}&t=1739590571889&appid=activities_platform&client=ios&clientVersion=15.0.15&cthr=1&loginType=&loginWQBiz=wegame`,
|
||||||
user,
|
user,
|
||||||
algo: {'appId': 'c06b7'},
|
algo: {'appId': 'c06b7',},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
if (this.haskey(home, 'code', 12)) {
|
||||||
|
p.context.finish = true
|
||||||
|
return
|
||||||
|
}
|
||||||
let drawNum = this.haskey(home, 'data.lotteryChances') || 0
|
let drawNum = this.haskey(home, 'data.lotteryChances') || 0
|
||||||
p.log("可抽奖次数:", drawNum)
|
p.log("可抽奖次数:", drawNum)
|
||||||
for (let i of Array(drawNum)) {
|
for (let i of Array(drawNum)) {
|
||||||
@ -417,7 +426,7 @@ export class Main extends Template {
|
|||||||
if (drawNum != 0) {
|
if (drawNum != 0) {
|
||||||
home = await this.curl({
|
home = await this.curl({
|
||||||
'url': `https://api.m.jd.com/api`,
|
'url': `https://api.m.jd.com/api`,
|
||||||
'form': `functionId=wheelsHome&body={"linkId":"wWGE5McZMFWkhTl-AN_TRQ","inviteActId":"","inviterEncryptPin":"","inviteCode":""}&t=1739590571889&appid=activities_platform&client=ios&clientVersion=15.0.15&cthr=1&loginType=&loginWQBiz=wegame`,
|
'form': `functionId=wheelsHome&body={"linkId":"${context.linkId}","inviteActId":"","inviterEncryptPin":"","inviteCode":""}&t=1739590571889&appid=activities_platform&client=ios&clientVersion=15.0.15&cthr=1&loginType=&loginWQBiz=wegame`,
|
||||||
user,
|
user,
|
||||||
algo: {'appId': 'c06b7'},
|
algo: {'appId': 'c06b7'},
|
||||||
}
|
}
|
||||||
@ -440,6 +449,10 @@ export class Main extends Template {
|
|||||||
algo: {'appId': 'eb67b', status: true},
|
algo: {'appId': 'eb67b', status: true},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
if (this.haskey(home, 'code', 12)) {
|
||||||
|
p.context.finish = true
|
||||||
|
return
|
||||||
|
}
|
||||||
let drawNum = this.haskey(home, 'data.prizeNum') || 0
|
let drawNum = this.haskey(home, 'data.prizeNum') || 0
|
||||||
p.log("可抽奖次数:", drawNum)
|
p.log("可抽奖次数:", drawNum)
|
||||||
for (let i of Array(drawNum)) {
|
for (let i of Array(drawNum)) {
|
||||||
@ -498,6 +511,10 @@ export class Main extends Template {
|
|||||||
algo: {'appId': 'b7d17', status: true},
|
algo: {'appId': 'b7d17', status: true},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
if (this.haskey(home, 'code', 12)) {
|
||||||
|
p.context.finish = true
|
||||||
|
return
|
||||||
|
}
|
||||||
let drawNum = this.haskey(home, 'data.remainTimes') || 0
|
let drawNum = this.haskey(home, 'data.remainTimes') || 0
|
||||||
p.log("可抽奖次数:", drawNum)
|
p.log("可抽奖次数:", drawNum)
|
||||||
for (let i of Array(drawNum)) {
|
for (let i of Array(drawNum)) {
|
||||||
@ -556,6 +573,10 @@ export class Main extends Template {
|
|||||||
algo: {'appId': 'd7439'},
|
algo: {'appId': 'd7439'},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
if (this.haskey(home, 'code', 12)) {
|
||||||
|
p.context.finish = true
|
||||||
|
return
|
||||||
|
}
|
||||||
let drawNum = this.haskey(home, 'data.remainTimes') || 0
|
let drawNum = this.haskey(home, 'data.remainTimes') || 0
|
||||||
let num = drawNum>5 ? 6 : drawNum
|
let num = drawNum>5 ? 6 : drawNum
|
||||||
p.log("可抽奖次数:", num)
|
p.log("可抽奖次数:", num)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user