This commit is contained in:
可达鸭 2025-03-21 09:14:31 +08:00
parent 5615d40750
commit 9f7a14e0d0
3 changed files with 208 additions and 55 deletions

View File

@ -51,61 +51,17 @@ export class Main extends Template {
else {
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("没有获取到数据...")
// }
let s = await this.curl({
'form': `functionId=bean_deliverySign_continue_award&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`,
algo: {
appId: '0cc57'
},
user
}
)
if (this.haskey(s, 'data.result.value')) {
p.award(s.data.result.value, 'bean')
}
}
}

View File

@ -0,0 +1,56 @@
import {Template} from '../../template.js'
export class Main extends Template {
constructor() {
super()
this.profile = {
title: '京东秒送每日领京豆',
crontab: 3,
interval: 1000
}
}
async prepare() {
}
async main(p) {
let user = p.data.user;
let context = p.context;
let detail = await this.curl({
'url': `https://api.m.jd.com/client.action?functionId=ds_signIn_querySignInDetail`,
'form': `avifSupport=0&body={"channelId":"rn01"}&build=169770&client=apple&clientVersion=15.0.65&d_brand=apple`,
algo: {
sign: true,
expire: {
"code": "0001"
}
},
user
}
)
let sign = await this.curl({
'form': `functionId=ds_signIn_signInGetRewards&avifSupport=0&body={"channelId":"rn01"}&build=169770&client=apple&clientVersion=15.0.65&d_brand=apple&d_model=iPhone13%2C3&ef=1`,
algo: {
sign: true,
},
user
}
)
if (this.haskey(sign, 'data.status', 1)) {
p.log(sign.data.rewardText)
p.info.work = true
for (let i of this.haskey(sign, 'data.rewardList')) {
if (i.beansAmount) {
p.award(i.beansAmount, 'bean')
}
else {
p.log(i)
}
}
}
else {
p.log("没有获取到京豆,可能已经签到过")
}
}
}

141
parse/jd/jd_task_luban.js Normal file
View File

@ -0,0 +1,141 @@
import {Template} from '../../template.js'
export class Main extends Template {
constructor() {
super()
this.profile = {
title: '京东逛新品赢红包',
crontab: 3,
interval: 1000
}
}
async prepare() {
let linkId = this.profile.linkId || '2m5K4HvCV4jNeTDixt56KGjroeLT'
let url = `https://prodev.m.jd.com/mall/active/${linkId}/index.html`
let html = await this.curl({
url,
}
)
let js = this.unique(this.matchAll(/(storage11.360buyimg.com\/ifloors\/\w+\/static\/js\/main.\w+.js)/g, html) || [])
let workflowId = "5b7b7ba0683542e3838798b04e2d8e92"
if (js) {
for (let j of js) {
let k = await this.curl({
url: `https://${j}`
}
)
let wkId = this.match(/workflowId\s*:\s*"(\w+)"/, k)
if (wkId) {
workflowId = wkId;
break
}
}
}
this.shareCode({
linkId, workflowId
})
}
async main(p) {
let user = p.data.user;
let context = p.context;
let floor = await this.curl({
'url': `https://api.m.jd.com/?functionId=qryH5BabelFloors`,
'form': `functionId=qryH5BabelFloors&appid=newtry&body={"activityId":"${context.linkId}","pageId":"4810055","queryFloorsParam":{"floorParams":{},"type":2}}`,
user,
algo: {
appId: '35fa0'
}
}
)
let gifts = []
let list = this.haskey(floor, 'floorList.0.providerData.data.assignments.assignmentList')
if (!list) {
p.log("没有获取到活动列表")
return
}
let status = 1
let uuid = context.workflowId
for (let i of list) {
if (i.completionCnt != i.assignmentTimesLimit) {
status = 0
p.log("正在运行:", i.assignmentName)
if (i.ext) {
let vos = i.ext.sign2 || i.ext.followShop || i.ext.brandMemberList || i.ext.shoppingActivity || i.ext.productsInfo
if (!vos) {
vos = [{
itemId: '1'
}]
}
for (let j of vos.splice(0, i.assignmentTimesLimit - i.completionCnt)) {
let doWork = await this.curl({
'url': `https://api.m.jd.com/?functionId=luban_executeWorkflow`,
'form': `functionId=luban_executeWorkflow&appid=newtry&client=ios&clientVersion=13.2.8&body={"workflowId":"${uuid}","action":1,"encAid":"${i.encryptAssignmentId}","itemId":"${j.itemId}","jumpUrl":"${encodeURIComponent(j.url)}"}`,
user,
algo: {
appId: '35fa0',
expire: {
'subCode': -23
}
}
}
)
if (this.haskey(doWork, 'subCode', '1403')) {
p.log('风险等级未通过')
return
}
if (i.ext.waitDuration) {
p.log(`等待${i.ext.waitDuration}`)
await this.wait(i.ext.waitDuration * 1000)
}
let r = await this.curl({
'url': `https://api.m.jd.com/?functionId=luban_executeWorkflow`,
'form': `functionId=luban_executeWorkflow&appid=newtry&client=ios&clientVersion=13.2.8&body={"workflowId":"${uuid}","action":0,"encAid":"${i.encryptAssignmentId}","itemId":"${j.itemId}","completionFlag":true}`,
user,
algo: {
appId: '35fa0'
}
}
)
if (this.haskey(r, 'rewardsInfo.successRewards')) {
for (let g in r.rewardsInfo.successRewards) {
let data = r.rewardsInfo.successRewards[g]
for (let k of data) {
p.award(k.discount, 'redpacket')
}
}
}
else {
p.log(`什么也没有抽到`)
}
status = 1
}
}
}
else {
p.log("任务已经完成:", i.assignmentName)
}
}
for (let i of Array(3)) {
let lottery = await this.curl({
'url': `https://api.m.jd.com/?functionId=luban_executeWorkflow`,
'form': `functionId=luban_executeWorkflow&appid=newtry&client=ios&clientVersion=13.2.8&body={"workflowId":"${uuid}","action":2,"completionFlag":true}`,
user,
algo: {
appId: '35fa0'
}
}
)
p.log("抽奖机:", lottery)
await this.wait(1000)
if (this.haskey(lottery, 'subCode', '-777')) {
break
}
}
if (status) {
p.info.work = true
}
}
}