Compare commits

..

No commits in common. "94ae72cd834155538928c88750a0174faeede0b8" and "a5b5b810ec9740e8d861e62a7c2498c0d145997a" have entirely different histories.

View File

@ -12,11 +12,9 @@ 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
interval: 8000
} }
} }
@ -82,29 +80,22 @@ 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'
if (this.profile.unionShareId) { for (let user of this.help) {
for (let shareId of this.profile.unionShareId.split("|")) { let shareUnion = await this.curl({
unionShareId.push(shareId) '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',
else { store: cookie,
for (let user of this.help) { },
let shareUnion = await this.curl({ referer: linkUrl,
'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=`, ua,
algo: { user
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)
} }
)
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({
@ -119,7 +110,7 @@ export class Main extends Template {
} }
} }
async main(p) { async main(p) {
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 || {}
@ -281,13 +272,10 @@ export class Main extends Template {
if (this.match(/\d+秒/, i.info)) { if (this.match(/\d+秒/, i.info)) {
let ts = (this.match(/(\d+)秒/, i.info)) let ts = (this.match(/(\d+)秒/, i.info))
try { try {
let z = await this.curl({ let z = await this.sign.jdCurl({
url: 'https://api.m.jd.com/client.action', url: 'https://api.m.jd.com/client.action',
form: `functionId=apResetTiming&body={"timerId":"${i.componentId}","uniqueId":"${i.taskId}"}&build=169498&client=${client}&clientVersion=13.2.8&d_brand=apple&d_model=iPhone13%2C3&ef=1`, form: `functionId=apResetTiming&body={"timerId":"${i.componentId}","uniqueId":"${i.taskId}"}&build=169498&client=${client}&clientVersion=13.2.8&d_brand=apple&d_model=iPhone13%2C3&ef=1`,
user, user
algo: {
sign: true
}
}) })
p.log("等待", ts) p.log("等待", ts)
await this.wait(parseInt(ts) * 1000) await this.wait(parseInt(ts) * 1000)
@ -338,7 +326,7 @@ export class Main extends Template {
) )
let getCoupons = await this.curl({ let getCoupons = await this.curl({
url: `https://api.m.jd.com/api`, url: `https://api.m.jd.com/api`,
form: `functionId=getCoupons&appid=u_hongbao&_=1716912812082&loginType=2&body={"actId":"${actId}","unionActId":"${unionActId}","platform":5,"d":"${d}","unionShareId":"","type":8,"qdPageId":"MO-J2011-1","mdClickId":"jxhongbao_ck","actType":1,"taskId":"${i.taskId}","agreeState":0}&client=${client}&clientVersion=1.1.0&stk=appid,body,client,clientVersion,functionId`, form: `functionId=getCoupons&appid=u_hongbao&_=1716912812082&loginType=2&body={"actId":"${actId}","unionActId":"${unionActId}","platform":5,"d":"${d}","unionShareId":"","type":8,"qdPageId":"MO-J2011-1","mdClickId":"jxhongbao_ck","actType":1,"taskId":"${i.taskId}","agreeState":0}&client=${client}&clientVersion=1.1.0&osVersion=iOS&screen=390*844&d_brand=iPhone&d_model=iPhone&lang=zh-CN&networkType=&openudid=&uuid=17165464753211715186324&aid=&oaid=&ext={"idfa":""}&x-api-eid-token=`,
user, user,
algo: { algo: {
appId: 'c822a', appId: 'c822a',
@ -354,7 +342,7 @@ export class Main extends Template {
) )
let getCoupons2 = await this.curl({ let getCoupons2 = await this.curl({
url: `https://api.m.jd.com/api`, url: `https://api.m.jd.com/api`,
form: `functionId=getCoupons&appid=u_hongbao&_=1716912812082&loginType=2&body={"actId":"${actId}","unionActId":"${unionActId}","platform":5,"d":"${d}","unionShareId":"","type":8,"qdPageId":"MO-J2011-1","mdClickId":"jxhongbao_ck","actType":1,"taskId":"${i.taskId}","agreeState":1}&client=${client}&clientVersion=1.1.0&stk=appid,body,client,clientVersion,functionId`, form: `functionId=getCoupons&appid=u_hongbao&_=1716912812082&loginType=2&body={"actId":"${actId}","unionActId":"${unionActId}","platform":5,"d":"${d}","unionShareId":"","type":8,"qdPageId":"MO-J2011-1","mdClickId":"jxhongbao_ck","actType":1,"taskId":"${i.taskId}","agreeState":1}&client=${client}&clientVersion=1.1.0&osVersion=iOS&screen=390*844&d_brand=iPhone&d_model=iPhone&lang=zh-CN&networkType=&openudid=&uuid=17165464753211715186324&aid=&oaid=&ext={"idfa":""}&x-api-eid-token=`,
user, user,
algo: { algo: {
appId: 'c822a', appId: 'c822a',
@ -412,7 +400,7 @@ export class Main extends Template {
} }
} }
let comp = await this.curl({ let comp = await this.curl({
'url': `https://api.m.jd.com/api?functionId=completeUnionTask&appid=u_activity_h5&loginType=2&client=${client}&clientVersion=&body={"unionActTask":"${(unionActTask)}"}`, 'url': `https://api.m.jd.com/api?functionId=completeUnionTask&appid=u_activity_h5&loginType=2&client=${client}&clientVersion=&body={"unionActTask":"${(unionActTask)}"}&x-api-eid-token=jdd01VD3JGEPGE54ERTF24JG43RNNY4NFEDZITDT3FYE6NYXFV2B27GNMA6R4QVHVRDBZKC7HS3BHZCRRFX2NBBN5TASNAQRGAFOZFYBTBDI01234567`,
// 'form':``, // 'form':``,
user, user,
algo: { algo: {
@ -428,31 +416,30 @@ export class Main extends Template {
} }
} }
} }
qry = await this.curl({ if (this.help.includes(user)) {
'url': `https://api.m.jd.com/api?functionId=queryFullGroupInfoMap&appid=u_hongbao&_=1716946027013&loginType=2&body={"actId":"${actId}","unionActId":"${unionActId}","platform":5,"d":"${d}","taskType":1,"prstate":0}&client=${client}&clientVersion=15.6.10&osVersion=15.1.1&screen=390*844&d_brand=iPhone&d_model=iPhone&lang=zh-CN&networkType=wifi&openudid=&aid=&oaid=`, qry = await this.curl({
user, 'url': `https://api.m.jd.com/api?functionId=queryFullGroupInfoMap&appid=u_hongbao&_=1716946027013&loginType=2&body={"actId":"${actId}","unionActId":"${unionActId}","platform":5,"d":"${d}","taskType":1,"prstate":0}&client=${client}&clientVersion=15.6.10&osVersion=15.1.1&screen=390*844&d_brand=iPhone&d_model=iPhone&lang=zh-CN&networkType=wifi&openudid=&aid=&oaid=`,
algo: {appId: '7b74b'} user,
} algo: {appId: '7b74b'}
) }
let getCoupons = await this.curl({ )
url: `https://api.m.jd.com/api`, let getCoupons = await this.curl({
form: `functionId=getCoupons&appid=u_hongbao&_=1716912812082&loginType=2&body={"actId":"${actId}","unionActId":"${unionActId}","platform":5,"d":"${d}","unionShareId":"","type":3,"qdPageId":"MO-J2011-1","mdClickId":"jxhongbao_ck","actType":1}&client=${client}&clientVersion=1.1.0&stk=appid,body,client,clientVersion,functionId`, url: `https://api.m.jd.com/api`,
user, form: `functionId=getCoupons&appid=u_hongbao&_=1716912812082&loginType=2&body={"actId":"${actId}","unionActId":"${unionActId}","platform":5,"d":"${d}","unionShareId":"","type":3,"qdPageId":"MO-J2011-1","mdClickId":"jxhongbao_ck","actType":1}&client=${client}&clientVersion=1.1.0&osVersion=iOS&screen=390*844&d_brand=iPhone&d_model=iPhone&lang=zh-CN&networkType=&openudid=&uuid=17165464753211715186324&aid=&oaid=&ext={"idfa":""}&x-api-eid-token=`,
algo: { user,
appId: 'c822a', algo: {
store, appId: 'c822a',
token: false, store,
expire: { token: false,
"code": -2, expire: {
} "code": -2,
}, }
ua, },
referer: linkUrl ua,
} referer: linkUrl
) }
gift.call(this, getCoupons) )
if (this.haskey(getCoupons, 'data.couponList.0.discount')) { gift.call(this, getCoupons)
p.info.work = true
} }
} catch (e) { } catch (e) {
} }