mirror of
https://github.com/qitoqito/psyduck.git
synced 2026-01-15 23:21:16 +08:00
Update jd_task_union.js
This commit is contained in:
parent
1c6fe5debc
commit
0708ef5030
@ -12,6 +12,7 @@ export class Main extends Template {
|
|||||||
sync: 1,
|
sync: 1,
|
||||||
prompt: {
|
prompt: {
|
||||||
shareUrl: '京享红包分享链接',
|
shareUrl: '京享红包分享链接',
|
||||||
|
unionShareId: '可选项,自定义unionShareId,请确保该id是基于shareUrl生成'
|
||||||
},
|
},
|
||||||
readme: ["风控较严,算法经常变动,锁佣需谨慎,如订单一直异常,请停用此脚本", "默认获取前3个账号分享码"],
|
readme: ["风控较严,算法经常变动,锁佣需谨慎,如订单一直异常,请停用此脚本", "默认获取前3个账号分享码"],
|
||||||
crontab: 1,
|
crontab: 1,
|
||||||
@ -81,24 +82,31 @@ export class Main extends Template {
|
|||||||
let d = this.match(/com\/(\w+)/, shareUrl)
|
let d = this.match(/com\/(\w+)/, shareUrl)
|
||||||
let unionShareId = []
|
let unionShareId = []
|
||||||
let client = ua.includes('Android') ? 'android' : 'apple'
|
let client = ua.includes('Android') ? 'android' : 'apple'
|
||||||
for (let user of this.help) {
|
if (this.profile.unionShareId) {
|
||||||
let shareUnion = await this.curl({
|
for (let shareId of this.profile.unionShareId.split("|")) {
|
||||||
'url': `https://api.m.jd.com/api?functionId=shareUnionCoupon&appid=u_hongbao&_=1716943673297&loginType=2&body={"unionActId":"${unionActId}","actId":"${actId}","platform":5,"unionShareId":"","d":"${d}","supportPic":2}&client=${client}&clientVersion=1.1.0&osVersion=15.1.1&screen=390*844&d_brand=iPhone&d_model=iPhone&lang=zh-CN&networkType=wifi&openudid=`,
|
|
||||||
algo: {
|
|
||||||
appId: 'c10dc',
|
|
||||||
store: cookie,
|
|
||||||
},
|
|
||||||
referer: linkUrl,
|
|
||||||
ua,
|
|
||||||
user
|
|
||||||
}
|
|
||||||
)
|
|
||||||
if (this.haskey(shareUnion, 'data.shareUrl')) {
|
|
||||||
let shareId = this.match(/s=(\w+)/, shareUnion.data.shareUrl)
|
|
||||||
this.log("获取账户", user, shareId)
|
|
||||||
unionShareId.push(shareId)
|
unionShareId.push(shareId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
for (let user of this.help) {
|
||||||
|
let shareUnion = await this.curl({
|
||||||
|
'url': `https://api.m.jd.com/api?functionId=shareUnionCoupon&appid=u_hongbao&_=1716943673297&loginType=2&body={"unionActId":"${unionActId}","actId":"${actId}","platform":5,"unionShareId":"","d":"${d}","supportPic":2}&client=${client}&clientVersion=1.1.0&osVersion=15.1.1&screen=390*844&d_brand=iPhone&d_model=iPhone&lang=zh-CN&networkType=wifi&openudid=`,
|
||||||
|
algo: {
|
||||||
|
appId: 'c10dc',
|
||||||
|
store: cookie,
|
||||||
|
},
|
||||||
|
referer: linkUrl,
|
||||||
|
ua,
|
||||||
|
user
|
||||||
|
}
|
||||||
|
)
|
||||||
|
if (this.haskey(shareUnion, 'data.shareUrl')) {
|
||||||
|
let shareId = this.match(/s=(\w+)/, shareUnion.data.shareUrl)
|
||||||
|
this.log("获取账户", user, shareId)
|
||||||
|
unionShareId.push(shareId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
this.shareCode({
|
this.shareCode({
|
||||||
shareUrl,
|
shareUrl,
|
||||||
d,
|
d,
|
||||||
@ -112,6 +120,7 @@ export class Main extends Template {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async main(p) {
|
async main(p) {
|
||||||
|
return
|
||||||
let user = p.data.user
|
let user = p.data.user
|
||||||
let context = p.context;
|
let context = p.context;
|
||||||
let algo = context.algo || {}
|
let algo = context.algo || {}
|
||||||
@ -443,6 +452,9 @@ export class Main extends Template {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
gift.call(this, getCoupons)
|
gift.call(this, getCoupons)
|
||||||
|
if (this.haskey(getCoupons, 'data.couponList.0.discount')) {
|
||||||
|
p.info.work = true
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user