mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-05-08 04:55:55 +08:00
update
This commit is contained in:
parent
092c743bde
commit
254cbd7d6e
File diff suppressed because one or more lines are too long
276
jd_dpqd.js
276
jd_dpqd.js
File diff suppressed because one or more lines are too long
229
jd_joy_joy_run.ts
Normal file
229
jd_joy_joy_run.ts
Normal file
@ -0,0 +1,229 @@
|
|||||||
|
/**
|
||||||
|
汪汪乐园-跑步
|
||||||
|
只能翻倍0.01能成功!
|
||||||
|
export JD_JOY_PARK_RUN_ASSETS="0.08"
|
||||||
|
32 * * * * jd_joy_joy_run.ts
|
||||||
|
new Env('极速版汪汪赛跑')
|
||||||
|
Modify By Dylan from HW
|
||||||
|
**/
|
||||||
|
|
||||||
|
import {get, post, o2s, requireConfig, wait} from './TS_USER_AGENTS'
|
||||||
|
import {H5ST} from "./function/h5st"
|
||||||
|
import {existsSync, readFileSync} from "fs";
|
||||||
|
import {getDate} from "date-fns";
|
||||||
|
|
||||||
|
let cookie: string = '', res: any = '', UserName: string = '', fp_448de: string = '' || process.env.FP_448DE, fp_b6ac3: string = '' || process.env.FP_B6AC3
|
||||||
|
let assets: number = 0, captainId: string = '', h5stTool: H5ST = null
|
||||||
|
|
||||||
|
!(async () => {
|
||||||
|
let cookiesArr: string[] = await requireConfig()
|
||||||
|
let account: { pt_pin: string, joy_park_run: number }[] = []
|
||||||
|
console.log('每周日18点组队分红!!')
|
||||||
|
for (let [index, value] of cookiesArr.entries()) {
|
||||||
|
cookie = value
|
||||||
|
UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1])
|
||||||
|
console.log(`\n开始【京东账号${index + 1}】${UserName}\n`)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
assets = parseFloat(process.env.JD_JOY_PARK_RUN_ASSETS || '0.01')
|
||||||
|
let rewardAmount: number = 0
|
||||||
|
try {
|
||||||
|
h5stTool = new H5ST('448de', 'jdltapp;', fp_448de)
|
||||||
|
await h5stTool.__genAlgo()
|
||||||
|
res = await team('runningMyPrize', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "pageSize": 20, "time": null, "ids": null})
|
||||||
|
let sum: number = 0, success: number = 0
|
||||||
|
for (let t of res?.data?.detailVos || []) {
|
||||||
|
if (t.amount > 0 && getDate(new Date(t.createTime)) === new Date().getDate()) {
|
||||||
|
sum = add(sum, t.amount)
|
||||||
|
success++
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('今日成功', success, '次')
|
||||||
|
console.log('今日收益', sum.toFixed(2), '元')
|
||||||
|
|
||||||
|
res = await team('runningTeamInfo', {"linkId": "L-sOanK_5RJCz7I314FpnQ"})
|
||||||
|
if (!captainId) {
|
||||||
|
if (res.data.members.length === 0) {
|
||||||
|
console.log('成为队长')
|
||||||
|
captainId = res.data.captainId
|
||||||
|
} else if (res.data.members.length !== 6) {
|
||||||
|
console.log('队伍未满', res.data.members.length, '人')
|
||||||
|
console.log('战队收益', res.data.teamSumPrize, '元')
|
||||||
|
captainId = res.data.captainId
|
||||||
|
} else {
|
||||||
|
console.log('队伍已满', res.data.members.length, '人')
|
||||||
|
console.log('战队收益', res.data.teamSumPrize, '元')
|
||||||
|
}
|
||||||
|
} else if (captainId && res.data.members.length === 0) {
|
||||||
|
console.log('已有组队ID,未加入队伍')
|
||||||
|
res = await team('runningJoinTeam', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "captainId": captainId})
|
||||||
|
if (res.code === 0) {
|
||||||
|
console.log('组队成功')
|
||||||
|
for (let member of res.data.members) {
|
||||||
|
if (member.captain) {
|
||||||
|
console.log('队长', member.nickName)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (res.data.members.length === 6) {
|
||||||
|
console.log('队伍已满')
|
||||||
|
captainId = ''
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
o2s(res, '组队失败')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('已组队', res.data.members.length, '人')
|
||||||
|
console.log('战队收益', res.data.teamSumPrize, '元')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
h5stTool = new H5ST('b6ac3', 'jdltapp;', fp_b6ac3)
|
||||||
|
await h5stTool.__genAlgo()
|
||||||
|
res = await runningPageHome()
|
||||||
|
console.log('🧧总金额', res.data.runningHomeInfo.prizeValue, '元')
|
||||||
|
|
||||||
|
let energy: number = res.data.runningHomeInfo.energy
|
||||||
|
console.log('💊 X', res.data.runningHomeInfo.energy, '个能量棒')
|
||||||
|
await wait(2000)
|
||||||
|
if (res.data.runningHomeInfo.nextRunningTime){
|
||||||
|
console.log('⏳体力恢复中,还有', secondsToMinutes(res.data.runningHomeInfo.nextRunningTime / 1000))
|
||||||
|
if (res.data.runningHomeInfo.nextRunningTime / 1000 < 300) {
|
||||||
|
await wait(res.data.runningHomeInfo.nextRunningTime)
|
||||||
|
res = await runningPageHome()
|
||||||
|
console.log('体力恢复完成,开始跑步....')
|
||||||
|
await wait(1000)
|
||||||
|
} else {
|
||||||
|
console.log('⏳等体力恢复在跑吧!');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('体力已恢复,开始跑步....')
|
||||||
|
}
|
||||||
|
|
||||||
|
await startRunning(res, assets)
|
||||||
|
for (let i = 0; i < energy; i++) {
|
||||||
|
console.log('💉消耗能量棒跑步....')
|
||||||
|
res = await api('runningUseEnergyBar', {"linkId": "L-sOanK_5RJCz7I314FpnQ"})
|
||||||
|
//console.log(res.errMsg)
|
||||||
|
res = await runningPageHome()
|
||||||
|
await startRunning(res, assets)
|
||||||
|
await wait(1000)
|
||||||
|
}
|
||||||
|
res = await runningPageHome()
|
||||||
|
console.log('🧧总金额', res.data.runningHomeInfo.prizeValue, '元')
|
||||||
|
await wait(2000)
|
||||||
|
} catch (e) {
|
||||||
|
console.log('Error', e)
|
||||||
|
await wait(3000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
|
||||||
|
async function startRunning(res: any, assets: number) {
|
||||||
|
if (!res.data.runningHomeInfo.nextRunningTime) {
|
||||||
|
console.log('终点目标', assets)
|
||||||
|
for (let i = 0; i < 5; i++) {
|
||||||
|
res = await api('runningOpenBox', {"linkId": "L-sOanK_5RJCz7I314FpnQ"})
|
||||||
|
if (parseFloat(res.data.assets) >= assets) {
|
||||||
|
let assets: number = parseFloat(res.data.assets)
|
||||||
|
res = await api('runningPreserveAssets', {"linkId": "L-sOanK_5RJCz7I314FpnQ"})
|
||||||
|
console.log('领取成功', assets)
|
||||||
|
break
|
||||||
|
} else {
|
||||||
|
if (res.data.doubleSuccess) {
|
||||||
|
console.log('翻倍成功', parseFloat(res.data.assets))
|
||||||
|
await wait(10000)
|
||||||
|
} else if (!res.data.doubleSuccess && !res.data.runningHomeInfo.runningFinish) {
|
||||||
|
console.log('开始跑步', parseFloat(res.data.assets))
|
||||||
|
await wait(10000)
|
||||||
|
} else {
|
||||||
|
console.log('翻倍失败')
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await wait(3000)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function api(fn: string, body: object) {
|
||||||
|
let timestamp: number = Date.now(), h5st: string = ''
|
||||||
|
if (fn === 'runningOpenBox') {
|
||||||
|
h5st = h5stTool.__genH5st({
|
||||||
|
appid: "activities_platform",
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
client: "ios",
|
||||||
|
clientVersion: "3.1.0",
|
||||||
|
functionId: "runningOpenBox",
|
||||||
|
t: timestamp.toString()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
let params: string = `functionId=${fn}&body=${JSON.stringify(body)}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=3.1.0&cthr=1`
|
||||||
|
h5st && (params += `&h5st=${h5st}`)
|
||||||
|
return await post('https://api.m.jd.com/', params, {
|
||||||
|
'authority': 'api.m.jd.com',
|
||||||
|
'content-type': 'application/x-www-form-urlencoded',
|
||||||
|
'cookie': cookie,
|
||||||
|
'origin': 'https://h5platform.jd.com',
|
||||||
|
'referer': 'https://h5platform.jd.com/',
|
||||||
|
'user-agent': 'jdltapp;'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function runningPageHome() {
|
||||||
|
return get(`https://api.m.jd.com/?functionId=runningPageHome&body=%7B%22linkId%22:%22L-sOanK_5RJCz7I314FpnQ%22,%22isFromJoyPark%22:true,%22joyLinkId%22:%22LsQNxL7iWDlXUs6cFl-AAg%22%7D&t=${Date.now()}&appid=activities_platform&client=ios&clientVersion=3.1.0`, {
|
||||||
|
'Host': 'api.m.jd.com',
|
||||||
|
'Origin': 'https://h5platform.jd.com',
|
||||||
|
'User-Agent': 'jdltapp;',
|
||||||
|
'Referer': 'https://h5platform.jd.com/',
|
||||||
|
'Cookie': cookie
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async function team(fn: string, body: object) {
|
||||||
|
let timestamp: number = Date.now(), h5st: string
|
||||||
|
h5st = h5stTool.__genH5st({
|
||||||
|
appid: "activities_platform",
|
||||||
|
body: JSON.stringify(body),
|
||||||
|
client: "ios",
|
||||||
|
clientVersion: "3.1.0",
|
||||||
|
functionId: fn,
|
||||||
|
t: timestamp.toString()
|
||||||
|
})
|
||||||
|
return await get(`https://api.m.jd.com/?functionId=${fn}&body=${encodeURIComponent(JSON.stringify(body))}&t=${timestamp}&appid=activities_platform&client=ios&clientVersion=3.1.0&cthr=1&h5st=${h5st}`, {
|
||||||
|
'Host': 'api.m.jd.com',
|
||||||
|
'User-Agent': 'jdltapp;',
|
||||||
|
'Origin': 'https://h5platform.jd.com',
|
||||||
|
'X-Requested-With': 'com.jd.jdlite',
|
||||||
|
'Referer': 'https://h5platform.jd.com/',
|
||||||
|
'Cookie': cookie
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 秒转时分秒
|
||||||
|
function secondsToMinutes(seconds: number) {
|
||||||
|
let minutes: number = Math.floor(seconds / 60)
|
||||||
|
let second: number = Math.floor(seconds % 60)
|
||||||
|
return `${minutes}分${second}秒`
|
||||||
|
}
|
||||||
|
|
||||||
|
// 小数加法
|
||||||
|
function add(num1: number, num2: number) {
|
||||||
|
let r1: number, r2: number
|
||||||
|
try {
|
||||||
|
r1 = num1.toString().split('.')[1].length
|
||||||
|
} catch (e) {
|
||||||
|
r1 = 0
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
r2 = num2.toString().split('.')[1].length
|
||||||
|
} catch (e) {
|
||||||
|
r2 = 0
|
||||||
|
}
|
||||||
|
let m: number = Math.pow(10, Math.max(r1, r2))
|
||||||
|
return (num1 * m + num2 * m) / m
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
24
jd_prodev.js
Normal file
24
jd_prodev.js
Normal file
File diff suppressed because one or more lines are too long
@ -1,15 +1,16 @@
|
|||||||
/*
|
/*
|
||||||
* 2022-07-20 修复获取试用列表风控问题;
|
|
||||||
* 2022-08-12 修复申请试用风控,更换nolan接口
|
* 2022-08-12 修复申请试用风控,更换nolan接口
|
||||||
* By https://github.com/6dylan6/jdpro/
|
* 如需运行请自行添加环境变量:JD_TRY,值填 true 即可运行
|
||||||
* 基于X1a0He版本修改
|
* 上一作者说了每天最多300个商店,总上限为500个,jd_unsubscribe.js我已更新为批量取关版
|
||||||
* @Address: https://github.com/X1a0He/jd_scripts_fixed/blob/main/jd_try_xh.js
|
* 请提前取关至少250个商店确保京东试用脚本正常运行
|
||||||
|
|
||||||
|
如需运行请自行添加环境变量:JD_TRY="true" 即可运行
|
||||||
脚本是否耗时只看args_xh.maxLength的大小(申请数量),默认50个,申请100个差不多15分钟
|
脚本是否耗时只看args_xh.maxLength的大小(申请数量),默认50个,申请100个差不多15分钟
|
||||||
上一作者说每天申请上限300个(自测,没有申请过上限),关注店铺上限500个
|
上一作者说每天申请上限300个(自测,没有申请过上限),关注店铺上限500个
|
||||||
关注店铺满了就无法继续申请,可用批量取关店铺取消关注
|
关注店铺满了就无法继续申请,可用批量取关店铺取消关注
|
||||||
|
|
||||||
部分环境变量说明,详细请参考58行往下:
|
部分环境变量说明,详细请参考58行往下:
|
||||||
|
export JD_TRY="true"是否允许,默认false
|
||||||
export JD_TRY_PASSZC="false" #不过滤种草官类试用,默认true过滤
|
export JD_TRY_PASSZC="false" #不过滤种草官类试用,默认true过滤
|
||||||
export JD_TRY_MAXLENGTH="50" #商品数组的最大长度,默认50个
|
export JD_TRY_MAXLENGTH="50" #商品数组的最大长度,默认50个
|
||||||
export JD_TRY_PRICE="XX"#商品原价格,大于XX才申请,默认20
|
export JD_TRY_PRICE="XX"#商品原价格,大于XX才申请,默认20
|
||||||
@ -18,13 +19,13 @@ export JD_TRY_APPLYNUMFILTER="10000" #过滤大于设定值的已申请人数
|
|||||||
export JD_TRY_MINSUPPLYNUM="1" #最小提供数量
|
export JD_TRY_MINSUPPLYNUM="1" #最小提供数量
|
||||||
export JD_TRY_SENDNUM="10" #每隔多少账号发送一次通知,默认为4
|
export JD_TRY_SENDNUM="10" #每隔多少账号发送一次通知,默认为4
|
||||||
export JD_TRY_UNIFIED="false" 默认采用不同试用组
|
export JD_TRY_UNIFIED="false" 默认采用不同试用组
|
||||||
export JD_TRY_NUM="5" 最多跑多少个CK,默认10
|
export JD_TRY_NUM="7" 最多跑多少个CK,默认10
|
||||||
|
|
||||||
定时自定义,能用多久随缘了!!!
|
cron "1 1 1 1 1" jd_try.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const $ = new Env('京东试用')
|
const $ = new Env('京东试用')
|
||||||
const URL = 'https://api.m.jd.com/client.action'
|
const URL = 'https://api.m.jd.com/client.action'
|
||||||
|
|
||||||
let trialActivityIdList = []
|
let trialActivityIdList = []
|
||||||
let trialActivityTitleList = []
|
let trialActivityTitleList = []
|
||||||
let notifyMsg = ''
|
let notifyMsg = ''
|
||||||
@ -40,19 +41,18 @@ $.getNum = 0;
|
|||||||
$.try = true;
|
$.try = true;
|
||||||
$.sentNum = 0;
|
$.sentNum = 0;
|
||||||
$.cookiesArr = []
|
$.cookiesArr = []
|
||||||
//默认的过滤关键词
|
|
||||||
$.innerKeyWords =
|
$.innerKeyWords =
|
||||||
[
|
[
|
||||||
"幼儿园", "教程", "英语", "辅导", "培训",
|
"幼儿园", "教程", "英语", "辅导", "培训",
|
||||||
"孩子", "小学", "成人用品", "套套", "情趣",
|
"孩子", "小学", "成人用品", "套套", "情趣",
|
||||||
"自慰", "阳具", "飞机杯", "男士用品", "女士用品",
|
"自慰", "阳具", "飞机杯", "男士用品", "女士用品",
|
||||||
"内衣", "高潮", "避孕", "乳腺", "肛塞", "肛门",
|
"内衣", "高潮", "避孕", "乳腺", "肛塞", "肛门",
|
||||||
"宝宝", "芭比", "娃娃", "男用",
|
"宝宝", "玩具", "芭比", "娃娃", "男用",
|
||||||
"女用", "神油", "足力健", "老年", "老人",
|
"女用", "神油", "足力健", "老年", "老人",
|
||||||
"宠物", "饲料", "丝袜", "黑丝", "磨脚",
|
"宠物", "饲料", "丝袜", "黑丝", "磨脚",
|
||||||
"脚皮", "除臭", "性感", "内裤", "跳蛋",
|
"脚皮", "除臭", "性感", "内裤", "跳蛋",
|
||||||
"安全套", "龟头", "阴道", "阴部", "手机卡", "电话卡", "流量卡",
|
"安全套", "龟头", "阴道", "阴部", "手机卡", "电话卡", "流量卡",
|
||||||
"习题", "试卷",
|
"玉坠","和田玉","习题","试卷","手机壳","钢化膜"
|
||||||
]
|
]
|
||||||
//下面很重要,遇到问题请把下面注释看一遍再来问
|
//下面很重要,遇到问题请把下面注释看一遍再来问
|
||||||
let args_xh = {
|
let args_xh = {
|
||||||
@ -187,114 +187,113 @@ let args_xh = {
|
|||||||
!(async () => {
|
!(async () => {
|
||||||
await $.wait(500)
|
await $.wait(500)
|
||||||
// 如果你要运行京东试用这个脚本,麻烦你把环境变量 JD_TRY 设置为 true
|
// 如果你要运行京东试用这个脚本,麻烦你把环境变量 JD_TRY 设置为 true
|
||||||
if (process.env.JD_TRY && process.env.JD_TRY === 'true') {
|
if (1) {
|
||||||
$.log('\n遇到问题请先看脚本内注释;解决不了可联系https://t.me/dylan_jdpro\n');
|
await requireConfig()
|
||||||
await requireConfig()
|
if (!$.cookiesArr[0]) {
|
||||||
if (!$.cookiesArr[0]) {
|
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {
|
||||||
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {
|
"open-url": "https://bean.m.jd.com/"
|
||||||
"open-url": "https://bean.m.jd.com/"
|
})
|
||||||
})
|
return
|
||||||
return
|
}
|
||||||
}
|
args_xh.tabId = args_xh.tabId.sort(() => 0.5 - Math.random())
|
||||||
args_xh.tabId = args_xh.tabId.sort(() => 0.5 - Math.random())
|
for (let i = 0; i < args_xh.try_num; i++) {
|
||||||
for (let i = 0; i < args_xh.try_num; i++) {
|
if ($.cookiesArr[i]) {
|
||||||
if ($.cookiesArr[i]) {
|
$.cookie = $.cookiesArr[i];
|
||||||
$.cookie = $.cookiesArr[i];
|
$.UserName = decodeURIComponent($.cookie.match(/pt_pin=(.+?);/) && $.cookie.match(/pt_pin=(.+?);/)[1])
|
||||||
$.UserName = decodeURIComponent($.cookie.match(/pt_pin=(.+?);/) && $.cookie.match(/pt_pin=(.+?);/)[1])
|
$.index = i + 1;
|
||||||
$.index = i + 1;
|
$.isLogin = true;
|
||||||
$.isLogin = true;
|
$.nickName = '';
|
||||||
$.nickName = '';
|
//await totalBean();
|
||||||
await totalBean();
|
console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`);
|
||||||
console.log(`\n开始【京东账号${$.index}】${$.nickName || $.UserName}\n`);
|
$.except = false;
|
||||||
$.except = false;
|
if(args_xh.except.includes($.UserName)){
|
||||||
if (args_xh.except.includes($.UserName)) {
|
console.log(`跳过账号:${$.nickName || $.UserName}`)
|
||||||
console.log(`跳过账号:${$.nickName || $.UserName}`)
|
$.except = true;
|
||||||
$.except = true;
|
continue
|
||||||
continue
|
}
|
||||||
}
|
if(!$.isLogin){
|
||||||
if (!$.isLogin) {
|
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {
|
||||||
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {
|
"open-url": "https://bean.m.jd.com/bean/signIndex.action"
|
||||||
"open-url": "https://bean.m.jd.com/bean/signIndex.action"
|
});
|
||||||
});
|
await $.notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
|
||||||
await $.notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
|
continue
|
||||||
continue
|
}
|
||||||
}
|
$.totalTry = 0
|
||||||
$.totalTry = 0
|
$.totalSuccess = 0
|
||||||
$.totalSuccess = 0
|
$.nowTabIdIndex = 0;
|
||||||
$.nowTabIdIndex = 0;
|
$.nowPage = 1;
|
||||||
$.nowPage = 1;
|
$.nowItem = 1;
|
||||||
$.nowItem = 1;
|
$.retrynum = 0
|
||||||
$.retrynum = 0
|
$.jda='__jda='+_jda('1xxxxxxxx.164xxxxxxxxxxxxxxxxxxx.164xxxxxxx.165xxxxxx.165xxxxxx.1xx')
|
||||||
$.jda = '__jda=' + _jda('1xxxxxxxx.164xxxxxxxxxxxxxxxxxxx.164xxxxxxx.165xxxxxx.165xxxxxx.1xx')
|
if (!args_xh.unified) {
|
||||||
if (!args_xh.unified) {
|
trialActivityIdList = []
|
||||||
trialActivityIdList = []
|
trialActivityTitleList = []
|
||||||
trialActivityTitleList = []
|
}
|
||||||
}
|
$.isLimit = false;
|
||||||
$.isLimit = false;
|
// 获取tabList的,不知道有哪些的把这里的注释解开跑一遍就行了
|
||||||
// 获取tabList的,不知道有哪些的把这里的注释解开跑一遍就行了
|
//await try_tabList();
|
||||||
//await try_tabList();
|
// return;
|
||||||
// return;
|
$.isForbidden = false
|
||||||
$.isForbidden = false
|
$.wrong = false
|
||||||
$.wrong = false
|
size = 1
|
||||||
size = 1
|
|
||||||
|
|
||||||
while (trialActivityIdList.length < args_xh.maxLength && $.retrynum < 3) {
|
while (trialActivityIdList.length < args_xh.maxLength && $.retrynum < 3) {
|
||||||
if ($.nowTabIdIndex === args_xh.tabId.length) {
|
if ($.nowTabIdIndex === args_xh.tabId.length) {
|
||||||
console.log(`tabId组已遍历完毕,不在获取商品\n`);
|
console.log(`tabId组已遍历完毕,不在获取商品\n`);
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
await try_feedsList(args_xh.tabId[$.nowTabIdIndex], $.nowPage) //获取对应tabId的试用页面
|
await try_feedsList(args_xh.tabId[$.nowTabIdIndex], $.nowPage) //获取对应tabId的试用页面
|
||||||
|
}
|
||||||
|
if (trialActivityIdList.length < args_xh.maxLength) {
|
||||||
|
console.log(`间隔等待中,请等待3秒 \n`)
|
||||||
|
await $.wait(3000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (trialActivityIdList.length < args_xh.maxLength) {
|
if ($.isForbidden === false && $.isLimit === false) {
|
||||||
console.log(`间隔等待中,请等待3秒 \n`)
|
console.log(`稍后将执行试用申请,请等待 2 秒\n`)
|
||||||
await $.wait(3000);
|
await $.wait(2000);
|
||||||
|
for (let i = 0; i < trialActivityIdList.length && $.isLimit === false; i++) {
|
||||||
|
if ($.isLimit) {
|
||||||
|
console.log("试用上限")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if ($.isForbidden) { console.log('403了,跳出'); break }
|
||||||
|
await try_apply(trialActivityTitleList[i], trialActivityIdList[i])
|
||||||
|
//console.log(`间隔等待中,请等待 ${args_xh.applyInterval} ms\n`)
|
||||||
|
const waitTime = generateRandomInteger(args_xh.applyInterval, 9000);
|
||||||
|
console.log(`随机等待${waitTime}ms后继续`);
|
||||||
|
await $.wait(waitTime);
|
||||||
|
}
|
||||||
|
console.log("试用申请执行完毕...")
|
||||||
|
// await try_MyTrials(1, 1) //申请中的商品
|
||||||
|
$.giveupNum = 0;
|
||||||
|
$.successNum = 0;
|
||||||
|
$.getNum = 0;
|
||||||
|
$.completeNum = 0;
|
||||||
|
await try_MyTrials(1, 2) //申请成功的商品
|
||||||
|
// await try_MyTrials(1, 3) //申请失败的商品
|
||||||
|
await showMsg()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($.isForbidden === false && $.isLimit === false) {
|
if ($.isNode()) {
|
||||||
console.log(`稍后将执行试用申请,请等待 2 秒\n`)
|
if ($.index % args_xh.sendNum === 0) {
|
||||||
await $.wait(2000);
|
$.sentNum++;
|
||||||
for (let i = 0; i < trialActivityIdList.length && $.isLimit === false; i++) {
|
console.log(`正在进行第 ${$.sentNum} 次发送通知,发送数量:${args_xh.sendNum}`)
|
||||||
if ($.isLimit) {
|
await $.notify.sendNotify(`${$.name}`, `${notifyMsg}`)
|
||||||
console.log("试用上限")
|
notifyMsg = "";
|
||||||
break
|
|
||||||
}
|
|
||||||
if ($.isForbidden) { console.log('403了,跳出'); break }
|
|
||||||
await try_apply(trialActivityTitleList[i], trialActivityIdList[i])
|
|
||||||
//console.log(`间隔等待中,请等待 ${args_xh.applyInterval} ms\n`)
|
|
||||||
const waitTime = generateRandomInteger(args_xh.applyInterval, 9000);
|
|
||||||
console.log(`随机等待${waitTime}ms后继续`);
|
|
||||||
await $.wait(waitTime);
|
|
||||||
}
|
}
|
||||||
console.log("试用申请执行完毕...")
|
|
||||||
// await try_MyTrials(1, 1) //申请中的商品
|
|
||||||
$.giveupNum = 0;
|
|
||||||
$.successNum = 0;
|
|
||||||
$.getNum = 0;
|
|
||||||
$.completeNum = 0;
|
|
||||||
await try_MyTrials(1, 2) //申请成功的商品
|
|
||||||
// await try_MyTrials(1, 3) //申请失败的商品
|
|
||||||
await showMsg()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($.isNode()) {
|
if ($.isNode() && $.except === false) {
|
||||||
if ($.index % args_xh.sendNum === 0) {
|
if (($.cookiesArr.length - ($.sentNum * args_xh.sendNum)) < args_xh.sendNum && notifyMsg.length != 0) {
|
||||||
$.sentNum++;
|
console.log(`正在进行最后一次发送通知,发送数量:${($.cookiesArr.length - ($.sentNum * args_xh.sendNum))}`)
|
||||||
console.log(`正在进行第 ${$.sentNum} 次发送通知,发送数量:${args_xh.sendNum}`)
|
|
||||||
await $.notify.sendNotify(`${$.name}`, `${notifyMsg}`)
|
await $.notify.sendNotify(`${$.name}`, `${notifyMsg}`)
|
||||||
notifyMsg = "";
|
notifyMsg = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ($.isNode() && $.except === false) {
|
|
||||||
if (($.cookiesArr.length - ($.sentNum * args_xh.sendNum)) < args_xh.sendNum && notifyMsg.length != 0) {
|
|
||||||
console.log(`正在进行最后一次发送通知,发送数量:${($.cookiesArr.length - ($.sentNum * args_xh.sendNum))}`)
|
|
||||||
await $.notify.sendNotify(`${$.name}`, `${notifyMsg}`)
|
|
||||||
notifyMsg = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log(`\n您未设置变量export JD_TRY="true"运行【京东试用】脚本, 结束运行!\n`)
|
console.log(`\n您未设置变量export JD_TRY="true"运行【京东试用】脚本, 结束运行!\n`)
|
||||||
}
|
}
|
||||||
})().catch((e) => {
|
})().catch((e) => {
|
||||||
console.error(`❗️ ${$.name} 运行错误!\n${e}`)
|
console.error(`❗️ ${$.name} 运行错误!\n${e}`)
|
||||||
}).finally(() => $.done())
|
}).finally(() => $.done())
|
||||||
@ -510,19 +509,19 @@ function try_apply(title, activityId) {
|
|||||||
body = await geth5st(body);
|
body = await geth5st(body);
|
||||||
if(!body) return;
|
if(!body) return;
|
||||||
let opt =
|
let opt =
|
||||||
{
|
{
|
||||||
"url": `${URL}?${body}}`,
|
"url": `${URL}?${body}}`,
|
||||||
'headers': {
|
'headers': {
|
||||||
'Cookie': $.cookie + $.jda,
|
'Cookie': $.cookie + $.jda,
|
||||||
'user-agent': 'jdapp;iPhone;10.1.2;15.0;ff2caa92a8529e4788a34b3d8d4df66d9573f499;network/wifi;model/iPhone13,4;addressid/2074196292;appBuild/167802;jdSupportDarkMode/1;Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
'user-agent': 'jdapp;iPhone;10.1.2;15.0;ff2caa92a8529e4788a34b3d8d4df66d9573f499;network/wifi;model/iPhone13,4;addressid/2074196292;appBuild/167802;jdSupportDarkMode/1;Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
|
||||||
'Referer': 'https://prodev.m.jd.com/',
|
'Referer': 'https://prodev.m.jd.com/',
|
||||||
'origin': 'https://prodev.m.jd.com/',
|
'origin': 'https://prodev.m.jd.com/',
|
||||||
'Accept': 'application/json,text/plain,*/*',
|
'Accept': 'application/json,text/plain,*/*',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'Accept-Encoding': 'gzip, deflate, br',
|
||||||
'Accept-Language': 'zh-cn',
|
'Accept-Language': 'zh-cn',
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
$.get(opt, (err, resp, data) => {
|
$.get(opt, (err, resp, data) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -974,7 +973,7 @@ function Env(name, opts) {
|
|||||||
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || []
|
if (!Array.isArray(path)) path = path.toString().match(/[^.[\]]+/g) || []
|
||||||
path.slice(0, -1).reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
|
path.slice(0, -1).reduce((a, c, i) => (Object(a[c]) === a[c] ? a[c] : (a[c] = Math.abs(path[i + 1]) >> 0 === +path[i + 1] ? [] : {})), obj)[
|
||||||
path[path.length - 1]
|
path[path.length - 1]
|
||||||
] = value
|
] = value
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1344,4 +1343,4 @@ function Env(name, opts) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})(name, opts)
|
})(name, opts)
|
||||||
}
|
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
58
jd_wxCollectionActivity2.js
Normal file
58
jd_wxCollectionActivity2.js
Normal file
File diff suppressed because one or more lines are too long
42
jd_wxShareActivity.js
Executable file
42
jd_wxShareActivity.js
Executable file
File diff suppressed because one or more lines are too long
8
jd_wxSignRed.js
Normal file
8
jd_wxSignRed.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user