1 Star 0 Fork 0

Mr不知为何/jd_scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
jd_cfd_shell.ts 2.47 KB
一键复制 编辑 原始数据 按行查看 历史
JDHelloWorld 提交于 2022-01-19 19:12 . cookiesArr: string[]
/**
* 财富岛捡贝壳挂后台
* cron: 10 0 * * *
*/
import axios from 'axios'
import {requireConfig, wait, requestAlgo, h5st, randomWord} from './TS_USER_AGENTS'
let cookie: string = '', res: any = ''
process.env.CFD_LOOP_DELAY ? console.log('设置延迟:', parseInt(process.env.CFD_LOOP_DELAY)) : console.log('设置延迟:10000~25000随机')
let UserName: string, index: number
!(async () => {
await requestAlgo()
let cookiesArr: string[] = await requireConfig()
while (1) {
if (new Date().getHours() === 0 && new Date().getMinutes() < 10)
break
for (let i = 0; i < cookiesArr.length; i++) {
cookie = cookiesArr[i]
UserName = decodeURIComponent(cookie.match(/pt_pin=([^;]*)/)![1])
index = i + 1
console.log(`\n开始【京东账号${index}${UserName}\n`)
try {
let shell: any = await speedUp('_cfd_t,bizCode,dwEnv,ptag,source,strZone')
if (shell?.Data?.NormShell) {
for (let s of shell.Data.NormShell) {
for (let j = 0; j < s.dwNum; j++) {
res = await speedUp('_cfd_t,bizCode,dwEnv,dwType,ptag,source,strZone', s.dwType)
if (res.iRet !== 0) {
console.log(res)
break
}
console.log('捡贝壳:', res.Data.strFirstDesc)
await wait(1500)
}
}
}
} catch (e) {
console.log(e)
}
}
await wait(60 * 10 * 1000) // 10min
}
})()
async function speedUp(stk: string, dwType?: number) {
try {
let url: string = stk === '_cfd_t,bizCode,dwEnv,ptag,source,strZone'
? `https://m.jingxi.com/jxbfd/story/queryshell?strZone=jxbfd&bizCode=jxbfd&source=jxbfd&dwEnv=7&_cfd_t=${Date.now()}&ptag=&_stk=_cfd_t%2CbizCode%2CdwEnv%2Cptag%2Csource%2CstrZone&_ste=1&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls`
: `https://m.jingxi.com/jxbfd/story/pickshell?strZone=jxbfd&bizCode=jxbfd&source=jxbfd&dwEnv=7&_cfd_t=${Date.now()}&ptag=&dwType=${dwType}&_stk=_cfd_t%2CbizCode%2CdwEnv%2CdwType%2Cptag%2Csource%2CstrZone&_ste=1&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBK${randomWord()}&g_ty=ls`
url = h5st(url, stk, {})
let {data} = await axios.get(url, {
headers: {
'Host': 'm.jingxi.com',
'Referer': 'https://st.jingxi.com/',
'User-Agent': 'jdpingou;',
'Cookie': cookie
}
})
return JSON.parse(data.match(/jsonpCBK.?\((.*)/)![1])
} catch (e) {
return ''
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/issuns/jd_scripts.git
git@gitee.com:issuns/jd_scripts.git
issuns
jd_scripts
jd_scripts
main

搜索帮助