This commit is contained in:
Faker 2023-03-31 16:55:43 +08:00
parent 909b8c6678
commit a48213641d
6 changed files with 82 additions and 473 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5,83 +5,86 @@ new Env('汪汪赛跑提现')
updateTime2022-07-09 updateTime2022-07-09
**/ **/
import {get, post, requireConfig, wait} from './TS_USER_AGENTS' import { get, post, requireConfig, wait } from './TS_USER_AGENTS'
import {H5ST} from "./function/h5st" import { H5ST } from "./function/h5st"
let cookie: string = '', res: any = '', UserName: string = '', fp_448de: string = '' || process.env.FP_448DE, fp_b6ac3: string = '' || process.env.FP_B6AC3 let cookie: string = '', res: any = '', UserName: string = '', fp_448de: string = '' || process.env.FP_448DE, fp_b6ac3: string = '' || process.env.FP_B6AC3
let h5stTool: H5ST = null let h5stTool: H5ST = null
!(async () => { !(async () => {
let cookiesArr: string[] = await requireConfig() let cookiesArr: string[] = await requireConfig()
for (let [index, value] of cookiesArr.entries()) { for (let [index, value] of cookiesArr.entries()) {
cookie = value cookie = value
UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1]) UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1])
console.log(`\n开始【京东账号${index + 1}${UserName}\n`) console.log(`\n开始【京东账号${index + 1}${UserName}\n`)
let rewardAmount: number = 0 let rewardAmount: number = 0
try { try {
h5stTool = new H5ST('448de', 'jdltapp;', fp_448de) h5stTool = new H5ST('448de', 'jdltapp;', fp_448de)
await h5stTool.__genAlgo() await h5stTool.__genAlgo()
res = await team('runningMyPrize', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "pageSize": 20, "time": null, "ids": null}) res = await team('runningMyPrize', { "linkId": "L-sOanK_5RJCz7I314FpnQ", "pageSize": 20, "time": null, "ids": null })
rewardAmount = res.data.rewardAmount rewardAmount = res.data.rewardAmount
if (res.data.runningCashStatus.currentEndTime) { if (res.data.runningCashStatus.currentEndTime) {
console.log('可提现', rewardAmount) console.log('可提现', rewardAmount)
res = await api('runningPrizeDraw', {"linkId": "L-sOanK_5RJCz7I314FpnQ", "type": 2, "level": 3}) res = await api('runningPrizeDraw', { "linkId": "L-sOanK_5RJCz7I314FpnQ", "type": 2, "level": 3 })
await wait(2000) if (res.errMsg.indexOf("不足") > -1) {
if (res.success){ res = await api('runningPrizeDraw', { "linkId": "L-sOanK_5RJCz7I314FpnQ", "type": 2, "level": 2 })
console.log(res.data.message) }
} else { await wait(1000)
console.log('提现失败:', res.errMsg) if (res.success) {
} console.log(res.data.message)
}else{ } else {
console.log('还未到提现时间') console.log('提现失败:', res.errMsg)
} }
} catch (e) { } else {
console.log('Error', e) console.log('还未到提现时间')
await wait(1000) }
} catch (e) {
console.log('Error', e)
await wait(1000)
}
} }
}
})() })()
async function api(fn: string, body: object) { async function api(fn: string, body: object) {
let timestamp: number = Date.now(), h5st: string = '' let timestamp: number = Date.now(), h5st: string = ''
if (fn === 'runningOpenBox') { if (fn === 'runningOpenBox') {
h5st = h5stTool.__genH5st({ h5st = h5stTool.__genH5st({
appid: "activities_platform", appid: "activities_platform",
body: JSON.stringify(body), body: JSON.stringify(body),
client: "ios", client: "ios",
clientVersion: "3.1.0", clientVersion: "3.1.0",
functionId: "runningOpenBox", functionId: "runningOpenBox",
t: timestamp.toString() 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;'
}) })
}
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 team(fn: string, body: object) { async function team(fn: string, body: object) {
let timestamp: number = Date.now(), h5st: string let timestamp: number = Date.now(), h5st: string
h5st = h5stTool.__genH5st({ h5st = h5stTool.__genH5st({
appid: "activities_platform", appid: "activities_platform",
body: JSON.stringify(body), body: JSON.stringify(body),
client: "ios", client: "ios",
clientVersion: "3.1.0", clientVersion: "3.1.0",
functionId: fn, functionId: fn,
t: timestamp.toString() 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}`, { 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', 'Host': 'api.m.jd.com',
'User-Agent': 'jdltapp;', 'User-Agent': 'jdltapp;',
'Origin': 'https://h5platform.jd.com', 'Origin': 'https://h5platform.jd.com',
'X-Requested-With': 'com.jd.jdlite', 'X-Requested-With': 'com.jd.jdlite',
'Referer': 'https://h5platform.jd.com/', 'Referer': 'https://h5platform.jd.com/',
'Cookie': cookie 'Cookie': cookie
}) })
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

11
jd_yy_realme.js Normal file

File diff suppressed because one or more lines are too long