├── .gitattributes ├── function ├── config.js ├── jdcookie.js ├── h5st.ts ├── eval.js ├── ql.js ├── krgetSign.js ├── jxAlgo.js ├── common.js ├── krgetToken.js ├── cache │ └── index.js └── krh5st.js ├── .gitignore ├── README.md ├── config └── CK_WxPusherUid.json ├── docker ├── extra.sh ├── docker-compose.yml ├── Readme.md └── ql1key.sh ├── package.json ├── jd_indeps.sh ├── jd_farm_automation.js ├── jd_try_notify.py ├── notify.md ├── jdCookie.js ├── jd_taskop.py ├── jd_kuaid.js ├── jd_fuli.js ├── jd_health_collect.js ├── jd_wrtred.js ├── jd_pay_contract.js ├── jd_kd.js └── jd_insight.js /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | *.png -text 3 | *.jpg -text -------------------------------------------------------------------------------- /function/config.js: -------------------------------------------------------------------------------- 1 | module.exports = {"ThreadJs":[],"invokeKey":"RtKLB8euDo7KwsO0"} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /yarn.lock 3 | /.idea 4 | /.history 5 | /box.dat 6 | /CookieSet.json 7 | /jdCookie.js 8 | /logs 9 | /JD_DailyBonus.js 10 | /result.txt 11 | .DS_Store 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 前言(必看) 2 | 3 | 君子慎独,不欺暗室, 卑以自牧,含章可贞。 4 | 5 | 大丈夫立于天地之间, 当仰天地浩然正气, 行光明磊落之事。 6 | 7 | 克己,慎独,守心,明性。 8 | 9 | 以克人之心克己, 以容己之心容人。 10 | 11 | 言尽于此,不想解释也不想回答!!! 12 | 13 | 建议不要使用本库。免生是非!!! 14 | 15 | 建议不要使用本库。免生是非!!! 16 | 17 | 建议不要使用本库。免生是非!!! -------------------------------------------------------------------------------- /config/CK_WxPusherUid.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "pt_pin": "中文账号名", 4 | "Uid": "UID_XXXXXXXXXXXXXXXXXXX" 5 | }, 6 | { 7 | "pt_pin": "XXXXXXX", 8 | "Uid": "UID_XXXXXXXXXXXXXXXXXXX" 9 | }, 10 | { 11 | "pt_pin": "XXXXXXX", 12 | "Uid": "UID_XXXXXXXXXXXXXXXXXXX" 13 | }, 14 | { 15 | "pt_pin": "XXXXXXX", 16 | "Uid": "UID_XXXXXXXXXXXXXXXXXXX" 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /docker/extra.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## 添加你需要重启自动执行的任意命令,比如 ql repo 4 | ## 安装node依赖使用 pnpm install -g xxx xxx 5 | ## 安装python依赖使用 pip3 install xxx 6 | pnpm install -g png-js 7 | pnpm install -g date-fns 8 | pnpm install -g axios 9 | pnpm install -g crypto-js 10 | pnpm install -g ts-md5 11 | pnpm install -g tslib 12 | pnpm install -g @types/node 13 | pnpm install -g requests 14 | pnpm install -g jsdom -------------------------------------------------------------------------------- /docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | ql_web: 4 | image: whyour/qinglong:2.11.3 5 | container_name: ql 6 | volumes: 7 | - ./data/config:/ql/config 8 | - ./data/log:/ql/log 9 | - ./data/db:/ql/db 10 | - ./data/scripts:/ql/scripts 11 | - ./data/repo:/ql/repo 12 | ports: 13 | - "0.0.0.0:5700:5700" 14 | environment: 15 | - ENABLE_HANGUP=true 16 | - ENABLE_WEB_PANEL=true 17 | restart: always 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "LXK9301", 3 | "version": "1.0.0", 4 | "description": "{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}", 5 | "main": "AlipayManor.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/LXK9301/jd_scripts.git" 12 | }, 13 | "keywords": [ 14 | "京东薅羊毛工具, 京东水果、宠物、种豆等等" 15 | ], 16 | "author": "LXK9301", 17 | "license": "ISC", 18 | "dependencies": { 19 | "crypto-js": "^4.0.0", 20 | "download": "^6.2.5", 21 | "got": "^11.5.1", 22 | "http-server": "^0.12.3", 23 | "qrcode-terminal": "^0.12.0", 24 | "request": "^2.88.2", 25 | "tough-cookie": "^4.0.0", 26 | "tunnel": "0.0.6", 27 | "ws": "^7.4.3", 28 | "png-js": "^1.0.0", 29 | "jsdom": "^17.0.0" 30 | } 31 | } -------------------------------------------------------------------------------- /jd_indeps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #依赖安装,运行一次就好 3 | #0 8 5 5 * jd_indeps.sh 4 | #new Env('依赖安装'); 5 | # 6 | 7 | npm_ver=`pnpm -v|awk -F. '{print $1}'` 8 | if [[ $npm_ver -ge 7 ]];then 9 | export PNPM_HOME="/root/.local/share/pnpm" 10 | export PATH="$PNPM_HOME:$PATH" 11 | fi 12 | 13 | echo -e "安装脚本所需依赖,不一定一次全部安装成功,请自己检查\n" 14 | echo -e "开始安装............\n" 15 | 16 | #apk add g++ make pixman-dev pango-dev cairo-dev pkgconf --no-cache 17 | apk add g++ make --no-cache 18 | pnpm config set registry https://registry.npm.taobao.org 19 | pnpm install -g 20 | pnpm install -g ds 21 | pnpm install -g png-js 22 | pnpm install -g date-fns 23 | pnpm install -g axios@0.27.2 24 | pnpm install -g crypto-js 25 | pnpm install -g ts-md5 26 | pnpm install -g tslib 27 | pnpm install -g @types/node 28 | pnpm install -g request 29 | pnpm install -g jsdom 30 | pnpm install -g moment 31 | pnpm install -g cheerio 32 | pnpm install -g tough-cookie 33 | pnpm install -g https-proxy-agent 34 | pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ jieba 35 | pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ requests 36 | rm -rf /usr/local/pnpm-global/5/node_modules/.pnpm/canvas* 37 | rm -rf /root/.local/share/pnpm/global/5/.pnpm/canvas* 38 | echo -e "\n所需依赖安装完成,请检查有没有报错,可尝试再次运行" -------------------------------------------------------------------------------- /function/jdcookie.js: -------------------------------------------------------------------------------- 1 | /* 2 | 此文件为Node.js专用。其他用户请忽略 3 | */ 4 | //此处填写京东账号cookie。 5 | let CookieJDs = [ 6 | '',//账号一ck,例:pt_key=XXX;pt_pin=XXX; 7 | '',//账号二ck,例:pt_key=XXX;pt_pin=XXX;如有更多,依次类推 8 | ] 9 | // 判断环境变量里面是否有京东ck 10 | if (process.env.JD_COOKIE) { 11 | if (process.env.JD_COOKIE.indexOf('&') > -1) { 12 | CookieJDs = process.env.JD_COOKIE.split('&'); 13 | } else if (process.env.JD_COOKIE.indexOf('\n') > -1) { 14 | CookieJDs = process.env.JD_COOKIE.split('\n'); 15 | } else { 16 | CookieJDs = [process.env.JD_COOKIE]; 17 | } 18 | } 19 | if (JSON.stringify(process.env).indexOf('GITHUB')>-1) { 20 | console.log(`请勿使用github action运行此脚本,无论你是从你自己的私库还是其他哪里拉取的源代码,都会导致我被封号\n`); 21 | !(async () => { 22 | await require('./sendNotify').sendNotify('提醒', `请勿使用github action、滥用github资源会封我仓库以及账号`) 23 | await process.exit(0); 24 | })() 25 | } 26 | CookieJDs = [...new Set(CookieJDs.filter(item => !!item))] 27 | console.log(`\n====================共${CookieJDs.length}个京东账号Cookie=================\n`); 28 | console.log(`============脚本执行时间:${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString('chinese',{hour12:false})}=============\n`) 29 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; 30 | for (let i = 0; i < CookieJDs.length; i++) { 31 | if (!CookieJDs[i].match(/pt_pin=(.+?);/) || !CookieJDs[i].match(/pt_key=(.+?);/)) console.log(`\n提示:京东cookie 【${CookieJDs[i]}】填写不规范,可能会影响部分脚本正常使用。正确格式为: pt_key=xxx;pt_pin=xxx;(分号;不可少)\n`); 32 | const index = (i + 1 === 1) ? '' : (i + 1); 33 | exports['CookieJD' + index] = CookieJDs[i].trim(); 34 | } 35 | console.log('>>>>>>>>>>>>>>6Dylan6 提示:任务正常运行中>>>>>>>>>>>>>>>\n') -------------------------------------------------------------------------------- /docker/Readme.md: -------------------------------------------------------------------------------- 1 | # Usage 2 | 3 | > 推荐使用`docker-compose`所以这里只介绍`docker-compose`使用方式 4 | 5 | 6 | 7 | ## Docker安装 8 | 9 | 10 | 11 | - 国内一键安装 `sudo curl -sSL https://get.daocloud.io/docker | sh` 12 | - 国外一键安装 `sudo curl -sSL get.docker.com | sh` 13 | - 北京外国语大学开源软件镜像站 `https://mirrors.bfsu.edu.cn/help/docker-ce/` 14 | 15 | 16 | docker-compose 安装(群晖`nas docker`自带安装了`docker-compose`) 17 | 18 | ``` 19 | curl -L https://get.daocloud.io/docker/compose/releases/download/v2.1.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose 20 | chmod +x /usr/local/bin/docker-compose 21 | ``` 22 | `Ubuntu`用户快速安装`docker-compose` 23 | ``` 24 | sudo apt-get update && sudo apt-get install -y python3-pip curl vim git moreutils 25 | pip3 install --upgrade pip 26 | pip install docker-compose 27 | ``` 28 | 29 | ## win10用户安装[docker desktop](https://www.docker.com/products/docker-desktop) 30 | 31 | 通过`docker-compose version`查看`docker-compose`版本,确认是否安装成功。 32 | 33 | 34 | 35 | ## 常用命令 36 | 37 | `docker-compose up -d` 启动(修改docker-compose.yml后需要使用此命令使更改生效); 38 | `docker-compose logs` 打印日志; 39 | `docker-compose logs -f` 打印日志,-f表示跟随日志; 40 | `docker logs -f qinglong` 和上面两条相比可以显示汉字; 41 | `docker-compose pull` 更新镜像; 42 | `docker-compose stop` 停止容器; 43 | `docker-compose restart` 重启容器; 44 | `docker-compose down` 停止并删除容器; 45 | 46 | ## 青龙一键部署(2.11.3版本) 47 | 48 | 1. 新建一个文件夹,用于存放相关数据 49 | 2. 下载本仓库中的`docker-compose.yml`至本地,或是复制文件内容后在本地自行建立并粘贴内容 50 | 3. 使用docker-compose启动 51 | 4. 浏览器输入ip:5700即可进入面板 52 | 53 | ###新建数据文件夹 54 | 55 | ```bash 56 | mkdir qinglong 57 | cd qinglong 58 | ``` 59 | 60 | ###下载或复制docker-compose.yml文件 61 | 62 | ```bash 63 | wget https://ghproxy.com/https://raw.githubusercontent.com/whyour/qinglong/develop/docker-compose.yml 64 | ``` 65 | 66 | ###启动 67 | 68 | ```bash 69 | docker-compose up -d 70 | ``` 71 | -------------------------------------------------------------------------------- /function/h5st.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios" 2 | import {format} from "date-fns" 3 | import * as CryptoJS from 'crypto-js' 4 | 5 | class H5ST { 6 | tk: string; 7 | timestamp: string; 8 | rd: string; 9 | appId: string; 10 | fp: string; 11 | time: number; 12 | ua: string 13 | enc: string; 14 | 15 | constructor(appId: string, ua: string, fp: string) { 16 | this.appId = appId 17 | this.ua = ua 18 | this.fp = fp || this.__genFp() 19 | } 20 | 21 | __genFp() { 22 | let e = "0123456789"; 23 | let a = 13; 24 | let i = ''; 25 | for (; a--;) 26 | i += e[Math.random() * e.length | 0]; 27 | return (i + Date.now()).slice(0, 16) 28 | } 29 | 30 | async __genAlgo() { 31 | this.time = Date.now() 32 | this.timestamp = format(this.time, "yyyyMMddHHmmssSSS") 33 | let {data} = await axios.post(`https://cactus.jd.com/request_algo?g_ty=ajax`, { 34 | 'version': '3.0', 35 | 'fp': this.fp, 36 | 'appId': this.appId.toString(), 37 | 'timestamp': this.time, 38 | 'platform': 'web', 39 | 'expandParams': '' 40 | }, { 41 | headers: { 42 | 'Host': 'cactus.jd.com', 43 | 'accept': 'application/json', 44 | 'content-type': 'application/json', 45 | 'user-agent': this.ua, 46 | } 47 | }) 48 | this.tk = data.data.result.tk 49 | this.rd = data.data.result.algo.match(/rd='(.*)'/)[1] 50 | this.enc = data.data.result.algo.match(/algo\.(.*)\(/)[1] 51 | } 52 | 53 | __genKey(tk: string, fp: string, ts: string, ai: string, algo: object) { 54 | let str = `${tk}${fp}${ts}${ai}${this.rd}`; 55 | return algo[this.enc](str, tk) 56 | } 57 | 58 | __genH5st(body: object) { 59 | let y = this.__genKey(this.tk, this.fp, this.timestamp, this.appId, CryptoJS).toString(CryptoJS.enc.Hex) 60 | let s = '' 61 | for (let key of Object.keys(body)) { 62 | key === 'body' ? s += `${key}:${CryptoJS.SHA256(body[key]).toString(CryptoJS.enc.Hex)}&` : s += `${key}:${body[key]}&` 63 | } 64 | s = s.slice(0, -1) 65 | s = CryptoJS.HmacSHA256(s, y).toString(CryptoJS.enc.Hex) 66 | return encodeURIComponent(`${this.timestamp};${this.fp};${this.appId.toString()};${this.tk};${s};3.0;${this.time.toString()}`) 67 | } 68 | } 69 | 70 | export { 71 | H5ST 72 | } 73 | -------------------------------------------------------------------------------- /function/eval.js: -------------------------------------------------------------------------------- 1 | function mainEval($) { 2 | return ` 3 | !(async () => { 4 | jdcookie = process.env.JD_COOKIE ? process.env.JD_COOKIE.split("&") : require("./function/jdcookie").cookie; 5 | cookies={ 6 | 'all':jdcookie, 7 | 'help': typeof(help) != 'undefined' ? [...jdcookie].splice(0,parseInt(help)):[] 8 | } 9 | $.sleep=cookies['all'].length * 500 10 | taskCookie=cookies['all'] 11 | jxAlgo = new common.jxAlgo(); 12 | if ($.readme) { 13 | console.log(\`使用说明:\\n\${$.readme}\\n以上内容仅供参考,有需求自行添加\\n\`,) 14 | } 15 | console.log(\`======================本次任务共\${taskCookie.length}个京东账户Cookie======================\\n\`) 16 | try{ 17 | await prepare(); 18 | 19 | if ($.sharecode.length > 0) { 20 | $.sharecode = $.sharecode.filter(d=>d && JSON.stringify(d)!='{}') 21 | console.log('助力码', $.sharecode ) 22 | } 23 | }catch(e1){console.log("初始函数不存在,将继续执行主函数Main\\n")} 24 | if (typeof(main) != 'undefined') { 25 | try{ 26 | for (let i = 0; i < taskCookie.filter(d => d).length; i++) { 27 | $.cookie = taskCookie[i]; 28 | $.user = decodeURIComponent($.cookie.match(/pt_pin=([^;]+)/)[1]) 29 | $.index = parseInt(i) + 1; 30 | let info = { 31 | 'index': $.index, 32 | 'user': $.user, 33 | 'cookie': $.cookie 34 | } 35 | if (!$.thread) { 36 | console.log(\`\n******开始【京东账号\${$.index}】\${$.user} 任务*********\n\`); 37 | } 38 | if ($.config[\`\${$.runfile}_except\`] && $.config[\`\${$.runfile}_except\`].includes(\$.user)) { 39 | console.log(\`全局变量\${$.runfile}_except中配置了该账号pt_pin,跳过此次任务\`) 40 | }else{ 41 | $.setCookie($.cookie) 42 | try{ 43 | if ($.sharecode.length > 0) { 44 | for (let smp of $.sharecode) { 45 | smp = Object.assign({ ...info}, smp); 46 | $.thread ? main(smp) : await main(smp); 47 | } 48 | }else{ 49 | $.thread ? main(info) : await main(info); 50 | } 51 | } 52 | catch(em){ 53 | console.log(em.message) 54 | } 55 | } 56 | 57 | 58 | } 59 | }catch(em){console.log(em.message)} 60 | if ($.thread) { 61 | await $.wait($.sleep) 62 | } 63 | } 64 | if (typeof(extra) != 'undefined') { 65 | console.log(\`============================开始运行额外任务============================\`) 66 | try{ 67 | await extra(); 68 | }catch(e4){console.log(e4.message)} 69 | } 70 | })().catch((e) => { 71 | console.log(e.message) 72 | }).finally(() => { 73 | if ($.message.length > 0) { 74 | $.notify($.message) 75 | } 76 | $.done(); 77 | }); 78 | 79 | ` 80 | } 81 | module.exports = { 82 | mainEval 83 | } 84 | -------------------------------------------------------------------------------- /jd_farm_automation.js: -------------------------------------------------------------------------------- 1 | //20 8 10 4 * jd_farm_automation.js 2 | 3 | console.log('默认种2级,如需调整请设置变量 M_JD_FARM_LEVEL\n使用率不高,指定(desi)账号运行\n') 4 | const {Env} = require('./function/magic'); 5 | const $ = new Env('农场自动种植兑换'); 6 | let level = process.env.M_JD_FARM_LEVEL ? process.env.M_JD_FARM_LEVEL * 1 : 2 7 | $.logic = async function () { 8 | let info = await api('initForFarm', 9 | {"version": 11, "channel": 3, "babelChannel": 0}); 10 | if (info.code !== '0') { 11 | $.log('可能没开通农场或者黑透了!!!') 12 | return 13 | } 14 | if (info.farmUserPro.treeState === 1) { 15 | return 16 | } 17 | if (info.farmUserPro.treeState === 2) { 18 | await $.wait(1000, 3000) 19 | $.log(`${info.farmUserPro.name},种植时间:${$.formatDate( 20 | info.farmUserPro.createTime)}`); 21 | //成熟了 22 | let coupon = await api('gotCouponForFarm', 23 | {"version": 11, "channel": 3, "babelChannel": 0}); 24 | $.log(coupon) 25 | info = await api('initForFarm', 26 | {"version": 11, "channel": 3, "babelChannel": 0}); 27 | } 28 | if (info.farmUserPro.treeState === 3) { 29 | let hongBao = info.myHongBaoInfo.hongBao; 30 | $.putMsg(`已兑换${hongBao.discount}红包,${$.formatDate(hongBao.endTime)}过期`) 31 | } 32 | 33 | let element = info.farmLevelWinGoods[level][0] || 0; 34 | await $.wait(1000, 3000) 35 | if (element) { 36 | info = await api('choiceGoodsForFarm', { 37 | "imageUrl": '', 38 | "nickName": '', 39 | "shareCode": '', 40 | "goodsType": element.type, 41 | "type": "0", 42 | "version": 11, 43 | "channel": 3, 44 | "babelChannel": 0 45 | }); 46 | if (info.code * 1 === 0) { 47 | $.putMsg(`\n再次种植【${info.farmUserPro.name}】`) 48 | } 49 | let a = await api('gotStageAwardForFarm', 50 | {"type": "4", "version": 11, "channel": 3, "babelChannel": 0}); 51 | let b = await api('waterGoodForFarm', 52 | {"type": "", "version": 11, "channel": 3, "babelChannel": 0}); 53 | let c = await api('gotStageAwardForFarm', 54 | {"type": "1", "version": 11, "channel": 3, "babelChannel": 0}); 55 | }else{ 56 | $.log('种子已抢完,下次在来!!!\n') 57 | } 58 | }; 59 | 60 | $.run({wait: [2000, 3000]}).catch(reason => $.log(reason)); 61 | 62 | // noinspection DuplicatedCode 63 | async function api(fn, body) { 64 | let url = `https://api.m.jd.com/client.action?functionId=${fn}&body=${JSON.stringify( 65 | body)}&client=apple&clientVersion=10.0.4&osVersion=13.7&appid=wh5&loginType=2&loginWQBiz=interact` 66 | //↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓请求头↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 67 | let headers = { 68 | "Cookie": $.cookie, 69 | "Connection": "keep-alive", 70 | "Accept": "*/*", 71 | "Host": "api.m.jd.com", 72 | 'User-Agent': `Mozilla/5.0 (iPhone; CPU iPhone OS 14_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.4(0x1800042c) NetType/4G Language/zh_CN miniProgram`, 73 | "Accept-Encoding": "gzip, deflate, br", 74 | "Accept-Language": "zh-cn" 75 | } 76 | let {data} = await $.request(url, headers) 77 | await $.wait(1000, 3000) 78 | return data; 79 | } 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /docker/ql1key.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #2.11.3版本青龙一键安装并添加拉库任务 3 | #端口5500 4 | #modify 2022-10-12 5 | 6 | Green="\033[32;1m" 7 | Red="\033[31m" 8 | Yellow="\033[33;1m" 9 | Blue="\033[36;1m" 10 | Font="\033[0m" 11 | GreenBG="\033[42;37m" 12 | RedBG="\033[41;37m" 13 | OK="${Green}[OK]${Font}" 14 | ERROR="${Red}[ERROR]${Font}" 15 | 16 | ok() { 17 | echo 18 | echo -e " ${OK} ${Green} $1 ${Font}" 19 | echo 20 | } 21 | error() { 22 | echo 23 | echo -e "${ERROR} ${RedBG} $1 ${Font}" 24 | echo 25 | } 26 | 27 | ing () { 28 | echo 29 | echo -e "${Yellow} $1 ${Font}" 30 | echo 31 | } 32 | 33 | 34 | if [[ ! "$USER" == "root" ]]; then 35 | error "警告:请使用root用户操作!~~" 36 | exit 1 37 | fi 38 | 39 | datav=/root/ql$(date +%Y%m%d) 40 | mkdir -p $datav && ql_path=$datav 41 | 42 | 43 | ql_run() { 44 | if [ -z "$(docker ps -a |awk '{print $NF}'| grep qinglong 2> /dev/null)" ]; then 45 | cd $ql_path 46 | cat > docker-compose.yml < /etc/docker/daemon.json < /usr/local/bin/docker-compose 124 | chmod +x /usr/local/bin/docker-compose 125 | ok "安装docker-compose...完成" 126 | fi 127 | } 128 | 129 | 130 | add_repo() { 131 | if [ "$(grep -c "6dylan6/jdpro" $ql_path/data/config/crontab.list)" != 0 ]; then 132 | error "您的任务列表中已存在拉库任务,刷新浏览器去执行拉库任务吧!" 133 | else 134 | ing "开始添加6dylan6/jdpro拉库任务" 135 | sed -i 's/RepoFileExtensions.*/RepoFileExtensions=\"js py sh ts\"/g' $ql_path/data/config/config.sh 136 | if [ "$(grep -c "token" $ql_path/data/config/auth.json)" != 0 ]; then 137 | docker exec -it qinglong /bin/bash -c "token=\$(cat /ql/config/auth.json | jq --raw-output .token) && curl -s -H 'Accept: application/json' -H \"Authorization: Bearer \$token\" -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept-Language: zh-CN,zh;q=0.9' --data-binary '{\"name\":\"拉库\",\"command\":\"ql repo https://ghproxy.com/https://github.com/6dylan6/jdpro.git \\\"jd_|jx_|jddj_\\\" \\\"backUp\\\" \\\"^jd[^_]|USER|JD|function|sendNotify\\\"\",\"schedule\":\"45 7-23/2 * * *\"}' --compressed 'http://127.0.0.1:5700/api/crons?t=1627380635389'" 138 | ok "已添加拉库任务,刷新浏览器后去执行拉库任务吧!" 139 | else 140 | error "未检测到 token,请访问web完成初始化并登陆进去后,在运行一次脚本" 141 | fi 142 | fi 143 | } 144 | 145 | ql_fix() { 146 | docker exec -it qinglong /bin/bash -c "grep -lr 'cdn.jsde' /ql/dist/|xargs sed -i 's#cdn.*.net/npm/#unpkg.com/#g'" 147 | docker exec -it qinglong /bin/bash -c "grep -lr 'unpkg.com' /ql/dist/ | xargs -I {} sh -c \"gzip -c {} > {}.gz\"" 148 | docker exec -it qinglong bash -c "curl -so /ql/deps/sendNotify.js https://js.dayplus.xyz/https://raw.githubusercontent.com/6dylan6/jdpro/main/sendNotify.js" 149 | } 150 | 151 | ing "开始部署青龙并创建拉库任务,速度根据您的网速决定,请耐心等待....." 152 | read -p "按任意键开始部署。。。" 153 | docker_install 154 | docker_compose 155 | ing "开始创建容器,如果长时间卡住 ctrl+c终止后重试!!!" 156 | ql_run 157 | ql_fix 158 | read -p "已初在浏览器始化并登陆青龙了?,那就按任意键继续!" 159 | add_repo 160 | sleep 2 161 | ok "已部署完成,2.11.3版本青龙,数据保存路径为$datav,容器名qinglong,访问地址http://ip:5500" 162 | 163 | -------------------------------------------------------------------------------- /function/ql.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const got = require('got'); 4 | require('dotenv').config(); 5 | const { readFile } = require('fs/promises'); 6 | const path = require('path'); 7 | 8 | const qlDir = '/ql'; 9 | const fs = require('fs'); 10 | let Fileexists = fs.existsSync('/ql/data/config/auth.json'); 11 | let authFile=""; 12 | if (Fileexists) 13 | authFile="/ql/data/config/auth.json" 14 | else 15 | authFile="/ql/config/auth.json" 16 | //const authFile = path.join(qlDir, 'config/auth.json'); 17 | 18 | const api = got.extend({ 19 | prefixUrl: 'http://127.0.0.1:5600', 20 | retry: { limit: 0 }, 21 | }); 22 | 23 | async function getToken() { 24 | const authConfig = JSON.parse(await readFile(authFile)); 25 | return authConfig.token; 26 | } 27 | 28 | module.exports.getEnvs = async () => { 29 | const token = await getToken(); 30 | const body = await api({ 31 | url: 'api/envs', 32 | searchParams: { 33 | searchValue: 'JD_COOKIE', 34 | t: Date.now(), 35 | }, 36 | headers: { 37 | Accept: 'application/json', 38 | authorization: `Bearer ${token}`, 39 | }, 40 | }).json(); 41 | return body.data; 42 | }; 43 | 44 | module.exports.getEnvsCount = async () => { 45 | const data = await this.getEnvs(); 46 | return data.length; 47 | }; 48 | 49 | module.exports.addEnv = async (cookie, remarks) => { 50 | const token = await getToken(); 51 | const body = await api({ 52 | method: 'post', 53 | url: 'api/envs', 54 | params: { t: Date.now() }, 55 | json: [{ 56 | name: 'JD_COOKIE', 57 | value: cookie, 58 | remarks, 59 | }], 60 | headers: { 61 | Accept: 'application/json', 62 | authorization: `Bearer ${token}`, 63 | 'Content-Type': 'application/json;charset=UTF-8', 64 | }, 65 | }).json(); 66 | return body; 67 | }; 68 | 69 | module.exports.updateEnv = async (cookie, eid, remarks) => { 70 | const token = await getToken(); 71 | const body = await api({ 72 | method: 'put', 73 | url: 'api/envs', 74 | params: { t: Date.now() }, 75 | json: { 76 | name: 'JD_COOKIE', 77 | value: cookie, 78 | _id: eid, 79 | remarks, 80 | }, 81 | headers: { 82 | Accept: 'application/json', 83 | authorization: `Bearer ${token}`, 84 | 'Content-Type': 'application/json;charset=UTF-8', 85 | }, 86 | }).json(); 87 | return body; 88 | }; 89 | 90 | module.exports.updateEnv11 = async (cookie, eid, remarks) => { 91 | const token = await getToken(); 92 | const body = await api({ 93 | method: 'put', 94 | url: 'api/envs', 95 | params: { t: Date.now() }, 96 | json: { 97 | name: 'JD_COOKIE', 98 | value: cookie, 99 | id: eid, 100 | remarks, 101 | }, 102 | headers: { 103 | Accept: 'application/json', 104 | authorization: `Bearer ${token}`, 105 | 'Content-Type': 'application/json;charset=UTF-8', 106 | }, 107 | }).json(); 108 | return body; 109 | }; 110 | 111 | module.exports.DisableCk = async (eid) => { 112 | const token = await getToken(); 113 | const body = await api({ 114 | method: 'put', 115 | url: 'api/envs/disable', 116 | params: { t: Date.now() }, 117 | body: JSON.stringify([eid]), 118 | headers: { 119 | Accept: 'application/json', 120 | authorization: `Bearer ${token}`, 121 | 'Content-Type': 'application/json;charset=UTF-8', 122 | }, 123 | }).json(); 124 | return body; 125 | }; 126 | 127 | module.exports.EnableCk = async (eid) => { 128 | const token = await getToken(); 129 | const body = await api({ 130 | method: 'put', 131 | url: 'api/envs/enable', 132 | params: { t: Date.now() }, 133 | body: JSON.stringify([eid]), 134 | headers: { 135 | Accept: 'application/json', 136 | authorization: `Bearer ${token}`, 137 | 'Content-Type': 'application/json;charset=UTF-8', 138 | }, 139 | }).json(); 140 | return body; 141 | }; 142 | 143 | module.exports.getstatus = async(eid) => { 144 | const envs = await this.getEnvs(); 145 | var tempid = 0; 146 | for (let i = 0; i < envs.length; i++) { 147 | tempid = 0; 148 | if (envs[i]._id) { 149 | tempid = envs[i]._id; 150 | } 151 | if (envs[i].id) { 152 | tempid = envs[i].id; 153 | } 154 | if (tempid == eid) { 155 | return envs[i].status; 156 | } 157 | } 158 | return 99; 159 | }; 160 | 161 | module.exports.getEnvById = async(eid) => { 162 | const envs = await this.getEnvs(); 163 | var tempid = 0; 164 | for (let i = 0; i < envs.length; i++) { 165 | tempid = 0; 166 | if (envs[i]._id) { 167 | tempid = envs[i]._id; 168 | } 169 | if (envs[i].id) { 170 | tempid = envs[i].id; 171 | } 172 | if (tempid == eid) { 173 | return envs[i].value; 174 | } 175 | } 176 | return ""; 177 | }; 178 | 179 | module.exports.getEnvByPtPin = async (Ptpin) => { 180 | const envs = await this.getEnvs(); 181 | for (let i = 0; i < envs.length; i++) { 182 | var tempptpin = decodeURIComponent(envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/) && envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/)[1]); 183 | if(tempptpin==Ptpin){ 184 | return envs[i]; 185 | } 186 | } 187 | return ""; 188 | }; 189 | 190 | module.exports.delEnv = async (eid) => { 191 | const token = await getToken(); 192 | const body = await api({ 193 | method: 'delete', 194 | url: 'api/envs', 195 | params: { t: Date.now() }, 196 | body: JSON.stringify([eid]), 197 | headers: { 198 | Accept: 'application/json', 199 | authorization: `Bearer ${token}`, 200 | 'Content-Type': 'application/json;charset=UTF-8', 201 | }, 202 | }).json(); 203 | return body; 204 | }; -------------------------------------------------------------------------------- /jd_try_notify.py: -------------------------------------------------------------------------------- 1 | 2 | """ 3 | cron: 10 20 * * * 4 | new Env('京东试用成功通知'); 5 | """ 6 | import requests 7 | import json 8 | import time 9 | import os 10 | import re 11 | import sys 12 | import random 13 | import string 14 | import urllib 15 | 16 | 17 | 18 | def randomuserAgent(): 19 | global uuid,addressid,iosVer,iosV,clientVersion,iPhone,area,ADID,lng,lat 20 | uuid=''.join(random.sample(['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','a','b','c','z'], 40)) 21 | addressid = ''.join(random.sample('1234567898647', 10)) 22 | iosVer = ''.join(random.sample(["15.1.1","14.5.1", "14.4", "14.3", "14.2", "14.1", "14.0.1"], 1)) 23 | iosV = iosVer.replace('.', '_') 24 | clientVersion=''.join(random.sample(["10.3.0", "10.2.7", "10.2.4"], 1)) 25 | iPhone = ''.join(random.sample(["8", "9", "10", "11", "12", "13"], 1)) 26 | area=''.join(random.sample('0123456789', 2)) + '_' + ''.join(random.sample('0123456789', 4)) + '_' + ''.join(random.sample('0123456789', 5)) + '_' + ''.join(random.sample('0123456789', 4)) 27 | ADID = ''.join(random.sample('0987654321ABCDEF', 8)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 4)) + '-' + ''.join(random.sample('0987654321ABCDEF', 12)) 28 | lng='119.31991256596'+str(random.randint(100,999)) 29 | lat='26.1187118976'+str(random.randint(100,999)) 30 | UserAgent='' 31 | if not UserAgent: 32 | return f'jdapp;iPhone;10.0.4;{iosVer};{uuid};network/wifi;ADID/{ADID};model/iPhone{iPhone},1;addressid/{addressid};appBuild/167707;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS {iosV} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/null;supportJDSHWK/1' 33 | else: 34 | return UserAgent 35 | 36 | #以上部分参考Curtin的脚本:https://github.com/curtinlv/JD-Script 37 | 38 | def load_send(): 39 | global send 40 | cur_path = os.path.abspath(os.path.dirname(__file__)) 41 | sys.path.append(cur_path) 42 | if os.path.exists(cur_path + "/sendNotify.py"): 43 | try: 44 | from sendNotify import send 45 | except: 46 | send=False 47 | print("加载通知服务失败~") 48 | else: 49 | send=False 50 | print("加载通知服务失败~") 51 | load_send() 52 | 53 | 54 | def printf(text): 55 | print(text) 56 | sys.stdout.flush() 57 | 58 | def get_remarkinfo(): 59 | url='http://127.0.0.1:5600/api/envs' 60 | try: 61 | with open('/ql/config/auth.json', 'r') as f: 62 | token=json.loads(f.read())['token'] 63 | headers={ 64 | 'Accept':'application/json', 65 | 'authorization':'Bearer '+token, 66 | } 67 | response=requests.get(url=url,headers=headers) 68 | 69 | for i in range(len(json.loads(response.text)['data'])): 70 | if json.loads(response.text)['data'][i]['name']=='JD_COOKIE': 71 | try: 72 | if json.loads(response.text)['data'][i]['remarks'].find('@@')==-1: 73 | remarkinfos[json.loads(response.text)['data'][i]['value'].split(';')[1].replace('pt_pin=','')]=json.loads(response.text)['data'][i]['remarks'].replace('remark=','') 74 | else: 75 | remarkinfos[json.loads(response.text)['data'][i]['value'].split(';')[1].replace('pt_pin=','')]=json.loads(response.text)['data'][i]['remarks'].split("@@")[0].replace('remark=','').replace(';','') 76 | except: 77 | pass 78 | except: 79 | print('读取auth.json文件出错,跳过获取备注') 80 | 81 | def get_succeedinfo(ck): 82 | jda = "__jda=1.1.1.1.1;" 83 | url='https://api.m.jd.com/client.action' 84 | headers={ 85 | 'accept':'application/json, text/plain, */*', 86 | 'content-type':'application/x-www-form-urlencoded', 87 | 'origin':'https://prodev.m.jd.com', 88 | 'accept-language':'zh-CN,zh-Hans;q=0.9', 89 | 'User-Agent': UserAgent, 90 | 'referer':'https://prodev.m.jd.com/', 91 | 'accept-encoding':'gzip, deflate', 92 | 'cookie': ck + jda 93 | } 94 | data=f'appid=newtry&functionId=try_MyTrials&uuid={uuid}&clientVersion={clientVersion}&client=wh5&osVersion={iosVer}&area={area}&networkType=wifi&body=%7B%22page%22%3A1%2C%22selected%22%3A2%2C%22previewTime%22%3A%22%22%7D' 95 | response=requests.post(url=url,headers=headers,data=data) 96 | isnull=True 97 | try: 98 | for i in range(len(json.loads(response.text)['data']['list'])): 99 | if(json.loads(response.text)['data']['list'][i]['text']['text']).find('试用资格将保留')!=-1: 100 | print(json.loads(response.text)['data']['list'][i]['trialName']) 101 | try: 102 | send("京东试用待领取物品通知",'账号名称:'+remarkinfos[ptpin]+'\n'+'商品名称:'+json.loads(response.text)['data']['list'][i]['trialName']+"\n"+"商品链接:https://item.jd.com/"+json.loads(response.text)['data']['list'][i]['skuId']+".html") 103 | isnull=False 104 | except: 105 | send("京东试用待领取物品通知",'账号名称:'+urllib.parse.unquote(ptpin)+'\n'+'商品名称:'+json.loads(response.text)['data']['list'][i]['trialName']+"\n"+"商品链接:https://item.jd.com/"+json.loads(response.text)['data']['list'][i]['skuId']+".html") 106 | isnull=False 107 | if isnull==True: 108 | print("没有在有效期内待领取的试用品\n\n") 109 | except: 110 | print('获取信息出错,可能是账号已过期') 111 | if __name__ == '__main__': 112 | remarkinfos={} 113 | try: 114 | get_remarkinfo() 115 | except: 116 | pass 117 | try: 118 | cks = os.environ["JD_COOKIE"].split("&") 119 | except: 120 | f = open("/jd/config/config.sh", "r", encoding='utf-8') 121 | cks = re.findall(r'Cookie[0-9]*="(pt_key=.*?;pt_pin=.*?;)"', f.read()) 122 | f.close() 123 | for ck in cks: 124 | ck = ck.strip() 125 | if ck[-1] != ';': 126 | ck += ';' 127 | ptpin = re.findall(r"pt_pin=(.*?);", ck)[0] 128 | try: 129 | if remarkinfos[ptpin]!='': 130 | printf("--账号:" + remarkinfos[ptpin] + "--") 131 | else: 132 | printf("--无备注账号:" + urllib.parse.unquote(ptpin) + "--") 133 | except Exception as e: 134 | printf("--账号:" + urllib.parse.unquote(ptpin) + "--") 135 | UserAgent=randomuserAgent() 136 | get_succeedinfo(ck) -------------------------------------------------------------------------------- /notify.md: -------------------------------------------------------------------------------- 1 | 2 | # 1. 注意事项: 3 | (1)如果发现账户名称不能被正确处理,请手动删除ql\scripts\CKName_cache.json 文件. 4 | 5 | (2)另外某些账号如果服务器返回空有可能不会被正确处理,请知悉. 6 | 7 | (3)ql.js 是jd_CheckCK.js和sendNotify.js的依赖, 只要你使用了这两个脚本就一定保证放在同个文件夹里面. 8 | 9 | (4)使用Ninjia要注意Extra.sh中把 cp sendNotify.js /ql/scripts/sendNotify.js 这一句删除,不然每次重启容器sendNotify.js都会被覆盖. 10 | 11 | (5)如果用不同的通知类型分组,比如TG作为组1,企业微信作为组2,且之前已经设置过企业微信通知的参数QYWX_AM,请先将QYWX_AM置空(export QYWX_AM=""),再设置组2的企业微信参数QYWX_AM2(export QYWX_AM2="abcdef")。否则原有的QYWX_AM参数仍在生效中,导致企业微信仍然接受到组1的通知.(来自Windstill的惨痛经历) 12 | 13 | # 2. 关于群组 14 | 原通知配置变量加上数字,组成新的通知群组.通知脚本目前支援5组变量. 15 | 16 | 例子:企业微信配置了QYWX_AM和QYWX_AM2,兑换通知时推送到的QYWX_AM2配置的企业微信.即群组2. 17 | 18 | (PS:例子使用了企业微信的变量QYWX_AM,实际是所有推送变量后加数字都会有效.) 19 | 20 | # 3. jd_bean_change.js (已添加支持一对一推送) 21 | 京东资产变动 + 白嫖榜 + 京东月资产变动,注意事项: 22 | 23 | 如果你遇到TG Bark报错,那是因为报文过长,请使用分段通知功能. 24 | 25 | CKName_cache.json 跟 CK_WxPusherUid.json 现在写死路径到ql/scripts 26 | 27 | 变量列表: 28 | 29 | (1) EANCHANGE_PERSENT 分段通知 30 | 例子 : export BEANCHANGE_PERSENT="10" 31 | 总共有22个账号,结果会分成3条推送通知,1~10为第一条推送,11~20为第二条推送,剩余的为第三条推送 32 | 33 | (2) BEANCHANGE_USERGP2 BEANCHANGE_USERGP3 BEANCHANGE_USERGP4 根据Pt_Pin的值进行分组通知 34 | 注意:分组通知会强制禁用BEANCHANGE_PERSENT变量! 35 | 分组通知的通知标题为 脚本名+"#"+分组数值 36 | 主要用于搭配通知脚本的分组通知使用. 37 | 38 | (3) BEANCHANGE_ENABLEMONTH (此功能已永久停用) 39 | 每月1号17点后如果执行资产查询,开启京东月资产变动的统计和推送. 40 | 拆分通知和分组通知的变量都可以兼容. 41 | 标题按照分组分别为 京东月资产变动 京东月资产变动#2 京东月资产变动#3 京东月资产变动#4 42 | 开启 : export BEANCHANGE_ENABLEMONTH="true" 43 | 44 | (4) BEANCHANGE_ALLNOTIFY 45 | 设置推送置顶公告,公告会出现在资产通知中(包括一对一),支持html语法. 46 | 例子 : export BEANCHANGE_ALLNOTIFY='ccwav 虽然头发块掉光了 47 | 可是还是很帅啊... 48 | 49 | 不说了,我去哭会....' 50 | 51 | 显示效果: 52 | 53 | 【✨✨✨✨公告✨✨✨✨】 54 | ccwav 虽然头发块掉光了 55 | 可是还是很帅啊... 56 | 57 | 不说了,我去哭会.... 58 | 59 | (5) BEANCHANGE_ExJxBeans 60 | 当设定BEANCHANGE_ExJxBeans="true"且时间在17点之后,会自动将临期京豆兑换成喜豆续命. 61 | 62 | (6) BEANCHANGE_DISABLELIST 63 | 关闭查询列表中的项目,自行删减.(攻略显示就是之前的提醒) 64 | export BEANCHANGE_DISABLELIST="汪汪乐园&京东赚赚&京东秒杀&东东农场&极速金币&京喜牧场&京喜工厂&京东工厂&领现金&喜豆查询&金融养猪&东东萌宠&活动攻略" 65 | 66 | 67 | 68 | # 4. sendNotify.js 69 | 发送通知脚本Pro. 70 | 71 | 集成自动禁用失效CK功能,当NOTIFY_AUTOCHECKCK=“true”时开启,默认关闭,原理是通过捕获任务脚本发送ck失效实现, 72 | 73 | 精准操作,支持一对一推送,通知标题还是以前的"京东CK检测",兼容jd_CheckCK.js的分组设定和CHECKCK_ALLNOTIFY设定. 74 | 75 | 变量列表: 76 | 77 | (1) NOTIFY_SKIP_LIST 78 | 如果通知标题在此变量里面存在(&隔开),则用屏蔽不发送通知.(PS: Ningjia 作者写的功能,继承过来.) 79 | 例子 : export NOTIFY_SKIP_LIST="京东CK检测&京东资产变动" 80 | 81 | (2) NOTIFY_GROUP2_LIST NOTIFY_GROUP3_LIST NOTIFY_GROUP4_LIST NOTIFY_GROUP5_LIST NOTIFY_GROUP6_LIST 82 | 如果通知标题在此变量里面存在(&隔开),则用第2/3/4/5/6套推送变量进行配置. 83 | 84 | (3) NOTIFY_SHOWNAMETYPE 85 | export NOTIFY_SHOWNAMETYPE="1" 不做任何变动 86 | export NOTIFY_SHOWNAMETYPE="2" 效果是 : 账号名称:别名(备注) 87 | export NOTIFY_SHOWNAMETYPE="3" 效果是 : 账号名称:pin(备注) 88 | export NOTIFY_SHOWNAMETYPE="4" 效果是 : 账号名称:备注 89 | 90 | (4) NOTIFY_SKIP_NAMETYPELIST 91 | 单独指定某些脚本不做NOTIFY_SHOWNAMETYPE变量处理 92 | 例子 : export NOTIFY_SKIP_NAMETYPELIST="东东农场&东东工厂" 93 | 94 | (5) 特殊标题控制,可以自行加载到第二点的变量中控制 95 | 东东农场领取 东东萌宠领取 京喜工厂领取 汪汪乐园养joy领取 脚本任务更新 96 | 97 | (6) NOTIFY_NOREMIND 98 | 对 东东农场领取 东东萌宠领取 京喜工厂领取 汪汪乐园养joy领取 脚本任务更新的通知进行屏蔽,可自行删减. 99 | export NOTIFY_NOREMIND="京喜工厂领取&汪汪乐园养joy领取" 100 | 101 | (7) NOTIFY_NOCKFALSE 102 | 屏蔽任务脚本的ck失效通知 103 | export NOTIFY_NOCKFALSE="true" 104 | 105 | (8) NOTIFY_AUTHOR 106 | 指定通知底部显示 本通知 By 后面显示的字符,默认是ccwav Mod 107 | 108 | (9) NOTIFY_NOLOGINSUCCESS 109 | 屏蔽青龙登陆成功通知,登陆失败不屏蔽(新版貌似可以直接设定了) 110 | export NOTIFY_NOLOGINSUCCESS="true" 111 | 112 | (10) NOTIFY_CUSTOMNOTIFY 113 | 强大的自定义通知,格式为 脚本名称&推送组别&推送类型 (推送组别总共5组) 114 | 推送类型: Server酱&pushplus&pushplushxtrip&Bark&TG机器人&钉钉&企业微信机器人&企业微信应用消息&iGotNotify&gobotNotify&WxPusher 115 | export NOTIFY_CUSTOMNOTIFY=["京东资产变动&组1&Server酱&Bark&企业微信应用消息","京东白嫖榜&组2&钉钉&pushplus"] 116 | 117 | (11) NOTIFY_CKTASK 118 | 当接收到发送CK失效通知和Ninja 运行通知时候执行子线程任务,支持js py ts 119 | 例子: export NOTIFY_CKTASK="jd_CheckCK.js" 120 | 121 | (12) PUSH_PLUS_TOKEN_hxtrip 和 PUSH_PLUS_USER_hxtrip 122 | 增加pushplus.hxtrip.com的推送加接口,貌似更稳定,注意这个和PUSHPLUS不是同一家. 123 | 124 | (13) 用 WxPusher 进行一对一推送 125 | 新方案; 126 | 填写变量 WP_APP_TOKEN_ONE,按照备注内容@@WxPusherUid的格式修改备注,例子 萌新cc@@UID_AASDADASDQWEQWDADASDADASDASDSA 127 | 旧方案: 128 | 详细教程有人写了,不知道是幸运还是不幸: https://www.kejiwanjia.com/jiaocheng/27909.html 129 | 填写变量 WP_APP_TOKEN_ONE,可在管理台查看: https://wxpusher.zjiecode.com/admin/main/app/appToken 130 | 手动建立CK_WxPusherUid.json,放通知脚本同级文件夹,可以参考CKName_cache.json,只是nickName改成Uid, 131 | 每个用户的uid可在管理台查看: https://wxpusher.zjiecode.com/admin/main/wxuser/list 132 | CK_WxPusherUid.json 内容(pt_pin 如果是汉字需要填写转码后的!): 133 | [ 134 | { 135 | "pt_pin": "ccwav", 136 | "Uid": "UID_AAAAAAAA" 137 | }, 138 | { 139 | "pt_pin": "中文名", 140 | "Uid": "BBBBBBBBBB" 141 | } 142 | ] 143 | 144 | (14) NOTIFY_SKIP_TEXT 145 | 如果此变量(&隔开)的关键字在通知内容里面存在,则屏蔽不发送通知. 146 | 例子 : export NOTIFY_SKIP_TEXT="忘了种植&异常" 147 | 148 | (15) NOTIFY_AUTHOR_BLANK (tcbaby提交) 149 | 控制不显示推送通知的底部信息 150 | 例子 : export NOTIFY_AUTHOR_BLANK="随便填只要非空即可" 151 | 152 | 153 | 154 | 155 | # 分组应用总结实例: 156 | 157 | ##CK失效时执行脚本 158 | export NOTIFY_CKTASK="ccwav_QLScript2_jd_CheckCK.js" 159 | 160 | ##开启月结资产推送 161 | export BEANCHANGE_ENABLEMONTH="true" 162 | 163 | ##分组2推送 164 | export QYWX_AM2="" 165 | export PUSH_PLUS_TOKEN2="ABCDEFGHIJKLMN" 166 | export PUSH_PLUS_USER2="Group2"; 167 | export BEANCHANGE_USERGP2="账号1pin&账号5pin&账号8pin" 168 | export NOTIFY_GROUP2_LIST="京东资产变动#2&京东白嫖榜#2&京东月资产变动#2&省钱大赢家之翻翻乐#2&京东CK检测#2" 169 | 170 | ##分组3推送 171 | export QYWX_AM3="" 172 | export PUSH_PLUS_TOKEN3="ABCDEFGHIJKLMN" 173 | export PUSH_PLUS_USER3="Group3"; 174 | export BEANCHANGE_USERGP2="账号2pin&账号3pin&账号4pin" 175 | export NOTIFY_GROUP3_LIST="京东资产变动#3&京东白嫖榜#3&京东月资产变动#3&省钱大赢家之翻翻乐#3&京东CK检测#3" 176 | 177 | ##分组4推送 178 | export QYWX_AM4="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaxxxxxxx" 179 | export BEANCHANGE_USERGP4="账号10pin&账号11pin&账号12pin" 180 | export NOTIFY_GROUP4_LIST="京东资产变动#4&京东白嫖榜#4&京东月资产变动#4&省钱大赢家之翻翻乐#4&Ninja 运行通知&京东CK检测#4" 181 | 182 | ##分组5推送 183 | export QYWX_AM5="" 184 | export PUSH_PLUS_TOKEN5="ABCDEFGHIJKLMN" 185 | export PUSH_PLUS_USER5="Group5"; 186 | export NOTIFY_GROUP5_LIST="京东资产变动&京东白嫖榜&京东月资产变动&省钱大赢家之翻翻乐&京东CK检测" 187 | 188 | 189 | ##分组6推送 190 | export QYWX_AM6="bbbbbbbbbbbbbbbbbbsccccccccccccccccc" 191 | export NOTIFY_GROUP6_LIST="东东农场领取&东东萌宠领取&汪汪乐园养joy领取&脚本任务更新" 192 | 193 | 194 | -------------------------------------------------------------------------------- /jdCookie.js: -------------------------------------------------------------------------------- 1 | /* 2 | 此文件为Node.js专用。其他用户请忽略 3 | */ 4 | //此处填写京东账号cookie。 5 | let CookieJDs = [ 6 | '',//账号一ck,例:pt_key=XXX;pt_pin=XXX; 7 | '',//账号二ck,例:pt_key=XXX;pt_pin=XXX;如有更多,依次类推 8 | ] 9 | let IP=''; 10 | // 判断环境变量里面是否有京东ck 11 | if (process.env.JD_COOKIE) { 12 | if (process.env.JD_COOKIE.indexOf('&') > -1) { 13 | CookieJDs = process.env.JD_COOKIE.split('&'); 14 | } else if (process.env.JD_COOKIE.indexOf('\n') > -1) { 15 | CookieJDs = process.env.JD_COOKIE.split('\n'); 16 | } else { 17 | CookieJDs = [process.env.JD_COOKIE]; 18 | } 19 | } 20 | if (JSON.stringify(process.env).indexOf('GITHUB')>-1) { 21 | console.log(`请勿使用github action运行此脚本,无论你是从你自己的私库还是其他哪里拉取的源代码,都会导致我被封号\n`); 22 | !(async () => { 23 | await require('./sendNotify').sendNotify('提醒', `请勿使用github action、滥用github资源会封我仓库以及账号`) 24 | await process.exit(0); 25 | })() 26 | } 27 | //!(async () => { 28 | // IP = await getIP(); 29 | // try { 30 | // IP = IP.match(/((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/)[0]; 31 | // console.log(`\n当前公网IP: ${IP}`); 32 | // } catch (e) { } 33 | //})() 34 | CookieJDs = [...new Set(CookieJDs.filter(item => !!item))] 35 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; 36 | console.log(`\n====================共${CookieJDs.length}个京东账号Cookie=================\n`); 37 | console.log(`============脚本执行时间:${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString('chinese',{hour12:false})}=============\n`) 38 | console.log('>>>>>>>>>>>>>>6Dylan6 提示:任务正常运行中>>>>>>>>>>>>>>>\n') 39 | for (let i = 0; i < CookieJDs.length; i++) { 40 | if (!CookieJDs[i].match(/pt_pin=(.+?);/) || !CookieJDs[i].match(/pt_key=(.+?);/)) console.log(`\n提示:京东cookie 【${CookieJDs[i]}】填写不规范,可能会影响部分脚本正常使用。正确格式为: pt_key=xxx;pt_pin=xxx;(分号;不可少)\n`); 41 | CookieJDs[i] = CookieJDs[i].replace(/[\u4e00-\u9fa5]/g, (str) => encodeURI(str)); 42 | const index = (i + 1 === 1) ? '' : (i + 1); 43 | exports['CookieJD' + index] = CookieJDs[i].trim(); 44 | } 45 | 46 | 47 | function getIP() { 48 | const https = require('https'); 49 | return new Promise((resolve, reject) => { 50 | let opt = { 51 | hostname: "www.cip.cc", 52 | port: 443, 53 | path: "/", 54 | method: "GET", 55 | headers: { 56 | "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36', 57 | }, 58 | timeout: 5000 59 | } 60 | const req = https.request(opt, (res) => { 61 | res.setEncoding('utf-8'); 62 | let tmp = ''; 63 | res.on('error', reject); 64 | res.on('data', d => tmp += d); 65 | res.on('end',() => resolve(tmp)); 66 | }); 67 | 68 | req.on('error', reject); 69 | req.end(); 70 | }); 71 | } 72 | // 以下为注入互助码环境变量(仅nodejs内起效)的代码 73 | function SetShareCodesEnv(nameChinese = "", nameConfig = "", envName = "") { 74 | let rawCodeConfig = {} 75 | let fs = require('fs') 76 | // 读取互助码 77 | let shareCodeLogPath = fs.existsSync(`${process.env.QL_DIR}/data`) ? `${process.env.QL_DIR}/data/log/.ShareCode/${nameConfig}.log` : `${process.env.QL_DIR}/log/.ShareCode/${nameConfig}.log`; 78 | if (fs.existsSync(shareCodeLogPath)) { 79 | // 因为faker2目前没有自带ini,改用已有的dotenv来解析 80 | // // 利用ini模块读取原始互助码和互助组信息 81 | // let ini = require('ini') 82 | // rawCodeConfig = ini.parse(fs.readFileSync(shareCodeLogPath, 'utf-8')) 83 | 84 | // 使用env模块 85 | require('dotenv').config({path: shareCodeLogPath}) 86 | rawCodeConfig = process.env 87 | } 88 | 89 | // 解析每个用户的互助码 90 | let codes = {} 91 | Object.keys(rawCodeConfig).forEach(function (key) { 92 | if (key.startsWith(`My${nameConfig}`)) { 93 | codes[key] = rawCodeConfig[key] 94 | } 95 | }); 96 | 97 | // 解析每个用户要帮助的互助码组,将用户实际的互助码填充进去 98 | let helpOtherCodes = {} 99 | Object.keys(rawCodeConfig).forEach(function (key) { 100 | if (key.startsWith(`ForOther${nameConfig}`)) { 101 | let helpCode = rawCodeConfig[key] 102 | for (const [codeEnv, codeVal] of Object.entries(codes)) { 103 | helpCode = helpCode.replace("${" + codeEnv + "}", codeVal) 104 | } 105 | 106 | helpOtherCodes[key] = helpCode 107 | } 108 | }); 109 | 110 | // 按顺序用&拼凑到一起,并放入环境变量,供目标脚本使用 111 | let shareCodes = [] 112 | let leftIndex = 1, rightIndex = Object.keys(helpOtherCodes).length 113 | 114 | // 判断是否是ptask并行触发,若是,则修改实际需要设置的互助码范围 115 | let ptaskLeft = process.env.PTASK_LEFT 116 | let ptaskRight = process.env.PTASK_RIGHT 117 | if (ptaskLeft && ptaskRight) { 118 | leftIndex = Number(ptaskLeft) 119 | rightIndex = Number(ptaskRight) 120 | } 121 | 122 | for (let idx = leftIndex; idx <= rightIndex; idx++) { 123 | shareCodes.push(helpOtherCodes[`ForOther${nameConfig}${idx}`]) 124 | } 125 | let shareCodesStr = shareCodes.join('&') 126 | process.env[envName] = shareCodesStr 127 | 128 | let totalCodeCount = rightIndex - leftIndex + 1 129 | //console.info(`${nameChinese}的 互助码环境变量 ${envName},共计 ${totalCodeCount} 组互助码,总大小为 ${shareCodesStr.length} 字节`) 130 | } 131 | 132 | // 判断当前活动脚本是否在互助脚本列表中 133 | function IsShareJsFile() { 134 | // 尝试获取在task_before.sh中设置的 互助活动的脚本文件名的关键部分 列表 135 | let rawJsNameList = process.env.ShareCodeJSNameList 136 | if (!rawJsNameList) { 137 | return false 138 | } 139 | 140 | // 转换为list 141 | let jsNameList = process.env.ShareCodeJSNameList.split(" ") 142 | 143 | // 判断当前 144 | let currentActivityScriptFileName = GetCurrentActivityScriptFileName() 145 | 146 | let isShareJsFile = false 147 | for (let idx = 0; idx < jsNameList.length; idx++) { 148 | if (currentActivityScriptFileName.includes(jsNameList[idx])) { 149 | isShareJsFile = true 150 | break 151 | } 152 | } 153 | 154 | return isShareJsFile 155 | } 156 | 157 | // 获取当前活动脚本的文件名 158 | function GetCurrentActivityScriptFileName() { 159 | const path = require('path') 160 | return path.basename(process.argv[1]) 161 | } 162 | 163 | // 若在task_before.sh 中设置了要设置互助码环境变量的活动名称和环境变量名称信息,则在nodejs中处理,供活动使用 164 | let nameChinese = process.env.ShareCodeConfigChineseName 165 | let nameConfig = process.env.ShareCodeConfigName 166 | let envName = process.env.ShareCodeEnvName 167 | if (nameChinese && nameConfig && envName) { 168 | SetShareCodesEnv(nameChinese, nameConfig, envName) 169 | } 170 | -------------------------------------------------------------------------------- /jd_taskop.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | """ 3 | cron: 15 2 * * * 4 | new Env('重复任务优化'); 5 | """ 6 | 7 | import json 8 | import logging 9 | import os 10 | import sys 11 | import time 12 | import traceback 13 | 14 | import requests 15 | 16 | logger = logging.getLogger(name=None) # 创建一个日志对象 17 | logging.Formatter("%(message)s") # 日志内容格式化 18 | logger.setLevel(logging.INFO) # 设置日志等级 19 | logger.addHandler(logging.StreamHandler()) # 添加控制台日志 20 | # logger.addHandler(logging.FileHandler(filename="text.log", mode="w")) # 添加文件日志 21 | 22 | 23 | ipport = os.getenv("IPPORT") 24 | if not ipport: 25 | logger.info( 26 | "如果报错请在环境变量中添加你的真实 IP:端口\n名称:IPPORT\t值:127.0.0.1:5700\n或在 config.sh 中添加 export IPPORT='127.0.0.1:5700'" 27 | ) 28 | ipport = "localhost:5700" 29 | else: 30 | ipport = ipport.lstrip("http://").rstrip("/") 31 | sub_str = os.getenv("RES_SUB", "6dylan6_jdpro") 32 | sub_list = sub_str.split("&") 33 | res_only = os.getenv("RES_ONLY", True) 34 | headers = { 35 | "Accept": "application/json", 36 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36", 37 | } 38 | 39 | 40 | def load_send() -> None: 41 | logger.info("加载推送功能中...") 42 | global send 43 | send = None 44 | cur_path = os.path.abspath(os.path.dirname(__file__)) 45 | sys.path.append(cur_path) 46 | if os.path.exists(cur_path + "/notify.py"): 47 | try: 48 | from notify import send 49 | except Exception: 50 | send = None 51 | logger.info(f"❌加载通知服务失败!!!\n{traceback.format_exc()}") 52 | 53 | 54 | def get_tasklist() -> list: 55 | tasklist = [] 56 | t = round(time.time() * 1000) 57 | url = f"http://{ipport}/api/crons?searchValue=&t={t}" 58 | response = requests.get(url=url, headers=headers) 59 | datas = json.loads(response.content.decode("utf-8")) 60 | if datas.get("code") == 200: 61 | try: 62 | tasklist = datas.get("data").get("data") 63 | except Exception: 64 | tasklist = datas.get("data") 65 | return tasklist 66 | 67 | 68 | def filter_res_sub(tasklist: list) -> tuple: 69 | filter_list = [] 70 | res_list = [] 71 | for task in tasklist: 72 | for sub in sub_list: 73 | if task.get("command").find(sub) == -1: 74 | flag = False 75 | else: 76 | flag = True 77 | break 78 | if flag: 79 | res_list.append(task) 80 | else: 81 | filter_list.append(task) 82 | return filter_list, res_list 83 | 84 | 85 | def get_index(lst: list, item: str) -> list: 86 | return [index for (index, value) in enumerate(lst) if value == item] 87 | 88 | 89 | def get_duplicate_list(tasklist: list) -> tuple: 90 | logger.info("\n=== 第一轮初筛开始 ===") 91 | 92 | ids = [] 93 | names = [] 94 | cmds = [] 95 | for task in tasklist: 96 | ids.append(task.get("_id",task.get("id"))) 97 | names.append(task.get("name")) 98 | cmds.append(task.get("command")) 99 | 100 | name_list = [] 101 | for i, name in enumerate(names): 102 | if name not in name_list: 103 | name_list.append(name) 104 | 105 | tem_tasks = [] 106 | tem_ids = [] 107 | dup_ids = [] 108 | for name2 in name_list: 109 | name_index = get_index(names, name2) 110 | for i in range(len(name_index)): 111 | if i == 0: 112 | logger.info(f"【✅保留】{cmds[name_index[0]]}") 113 | tem_tasks.append(tasklist[name_index[0]]) 114 | tem_ids.append(ids[name_index[0]]) 115 | else: 116 | logger.info(f"【🚫禁用】{cmds[name_index[i]]}") 117 | dup_ids.append(ids[name_index[i]]) 118 | logger.info("") 119 | 120 | logger.info("=== 第一轮初筛结束 ===") 121 | 122 | return tem_ids, tem_tasks, dup_ids 123 | 124 | 125 | def reserve_task_only( 126 | tem_ids: list, tem_tasks: list, dup_ids: list, res_list: list 127 | ) -> list: 128 | if len(tem_ids) == 0: 129 | return tem_ids 130 | 131 | logger.info("\n=== 最终筛选开始 ===") 132 | task3 = None 133 | for task1 in tem_tasks: 134 | for task2 in res_list: 135 | if task1.get("name") == task2.get("name"): 136 | dup_ids.append(task1.get("_id",task1.get("id"))) 137 | logger.info(f"【✅保留】{task2.get('command')}") 138 | task3 = task1 139 | if task3: 140 | logger.info(f"【🚫禁用】{task3.get('command')}\n") 141 | task3 = None 142 | logger.info("=== 最终筛选结束 ===") 143 | return dup_ids 144 | 145 | 146 | def disable_duplicate_tasks(ids: list) -> None: 147 | t = round(time.time() * 1000) 148 | url = f"http://{ipport}/api/crons/disable?t={t}" 149 | data = json.dumps(ids) 150 | headers["Content-Type"] = "application/json;charset=UTF-8" 151 | response = requests.put(url=url, headers=headers, data=data) 152 | datas = json.loads(response.content.decode("utf-8")) 153 | if datas.get("code") != 200: 154 | logger.info(f"❌出错!!!错误信息为:{datas}") 155 | else: 156 | logger.info("🎉成功禁用重复任务~") 157 | 158 | 159 | def get_token() -> str or None: 160 | path = '/ql/config/auth.json' # 设置青龙 auth文件地址 161 | global flag1 162 | flag1 = True 163 | if not os.path.isfile(path): 164 | path = '/ql/data/config/auth.json' # 尝试设置青龙 auth 新版文件地址 165 | flag1 = False 166 | try: 167 | with open(path, "r", encoding="utf-8") as f: 168 | data = json.load(f) 169 | except Exception: 170 | logger.info(f"❌无法获取 token!!!\n{traceback.format_exc()}") 171 | send("禁用重复任务失败", "无法获取 token!!!") 172 | exit(1) 173 | return data.get("token") 174 | 175 | 176 | if __name__ == "__main__": 177 | logger.info("===> 禁用重复任务开始 <===") 178 | load_send() 179 | token = get_token() 180 | headers["Authorization"] = f"Bearer {token}" 181 | 182 | # 获取过滤后的任务列表 183 | sub_str = "\n".join(sub_list) 184 | logger.info(f"\n=== 你选择过滤的任务前缀为 ===\n{sub_str}") 185 | tasklist = get_tasklist() 186 | if len(tasklist) == 0: 187 | logger.info("❌无法获取 tasklist!!!") 188 | exit(1) 189 | filter_list, res_list = filter_res_sub(tasklist) 190 | 191 | tem_ids, tem_tasks, dup_ids = get_duplicate_list(filter_list) 192 | # 是否在重复任务中只保留设置的前缀 193 | if res_only: 194 | ids = reserve_task_only(tem_ids, tem_tasks, dup_ids, res_list) 195 | else: 196 | ids = dup_ids 197 | logger.info("你选择保留除了设置的前缀以外的其他任务") 198 | 199 | sum = f"所有任务数量为:{len(tasklist)}" 200 | filter = f"过滤的任务数量为:{len(res_list)}" 201 | disable = f"禁用的任务数量为:{len(ids)}" 202 | logging.info("\n=== 禁用数量统计 ===\n" + sum + "\n" + filter + "\n" + disable) 203 | 204 | if len(ids) == 0: 205 | logger.info("😁没有重复任务~") 206 | else: 207 | disable_duplicate_tasks(ids) 208 | #if send: 209 | #send("💖禁用重复任务成功", f"\n{sum}\n{filter}\n{disable}") 210 | -------------------------------------------------------------------------------- /function/krgetSign.js: -------------------------------------------------------------------------------- 1 | var version_='jsjiami.com.v7';const lIIllIlI=li1iI11;(function(lIi1l1il,IlI11Il,iil1ilIi,lIlIiiiI,lIi1II1I,il11I1l,I1iillli){return lIi1l1il=lIi1l1il>>0x1,il11I1l='hs',I1iillli='hs',function(IIiiI1l1,lIilIIl,il1IiI1I,IliilIii,li1IiIil){const ll1I1il1=li1iI11;IliilIii='tfi',il11I1l=IliilIii+il11I1l,li1IiIil='up',I1iillli+=li1IiIil,il11I1l=il1IiI1I(il11I1l),I1iillli=il1IiI1I(I1iillli),il1IiI1I=0x0;const IiIIlIiI=IIiiI1l1();while(!![]&&--lIlIiiiI+lIilIIl){try{IliilIii=parseInt(ll1I1il1(0x158,'sqKC'))/0x1*(parseInt(ll1I1il1(0x17d,'&$qj'))/0x2)+parseInt(ll1I1il1(0x15c,'!hF3'))/0x3*(-parseInt(ll1I1il1(0x184,'VME9'))/0x4)+-parseInt(ll1I1il1(0x170,'eXg1'))/0x5+-parseInt(ll1I1il1(0x16e,'gg^N'))/0x6*(-parseInt(ll1I1il1(0x18f,'m*e*'))/0x7)+-parseInt(ll1I1il1(0x191,'$15w'))/0x8*(parseInt(ll1I1il1(0x183,'4Z&V'))/0x9)+-parseInt(ll1I1il1(0x171,'N3K3'))/0xa+-parseInt(ll1I1il1(0x195,'%!oX'))/0xb*(-parseInt(ll1I1il1(0x166,'sqKC'))/0xc);}catch(iIiiilI1){IliilIii=il1IiI1I;}finally{li1IiIil=IiIIlIiI[il11I1l]();if(lIi1l1il<=lIlIiiiI)il1IiI1I?lIi1II1I?IliilIii=li1IiIil:lIi1II1I=li1IiIil:il1IiI1I=li1IiIil;else{if(il1IiI1I==lIi1II1I['replace'](/[wJLgluUBFeXqOyCV=]/g,'')){if(IliilIii===lIilIIl){IiIIlIiI['un'+il11I1l](li1IiIil);break;}IiIIlIiI[I1iillli](li1IiIil);}}}}}(iil1ilIi,IlI11Il,function(Ii1l1lll,i111III1,I11ilIii,iIiIiIiI,ll1liil1,IlIl1lIi,Il1i1lI){return i111III1='\x73\x70\x6c\x69\x74',Ii1l1lll=arguments[0x0],Ii1l1lll=Ii1l1lll[i111III1](''),I11ilIii='\x72\x65\x76\x65\x72\x73\x65',Ii1l1lll=Ii1l1lll[I11ilIii]('\x76'),iIiIiIiI='\x6a\x6f\x69\x6e',(0x12db7d,Ii1l1lll[iIiIiIiI](''));});}(0x196,0x54686,Iill1Ili,0xcd),Iill1Ili)&&(version_=Iill1Ili);function li1iI11(_0x10ecd6,_0x5aff87){const _0x202c65=Iill1Ili();return li1iI11=function(_0x8ba3ca,_0x4897ed){_0x8ba3ca=_0x8ba3ca-0x153;let _0x147546=_0x202c65[_0x8ba3ca];if(li1iI11['rrzZUy']===undefined){var _0x2b3cd9=function(_0x5be9c1){const _0x1f9529='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x15739c='',_0x1d3ab5='';for(let _0x2b91f3=0x0,_0x21cc12,_0x28de43,_0x498da8=0x0;_0x28de43=_0x5be9c1['charAt'](_0x498da8++);~_0x28de43&&(_0x21cc12=_0x2b91f3%0x4?_0x21cc12*0x40+_0x28de43:_0x28de43,_0x2b91f3++%0x4)?_0x15739c+=String['fromCharCode'](0xff&_0x21cc12>>(-0x2*_0x2b91f3&0x6)):0x0){_0x28de43=_0x1f9529['indexOf'](_0x28de43);}for(let _0xafcbec=0x0,_0x263e3f=_0x15739c['length'];_0xafcbec<_0x263e3f;_0xafcbec++){_0x1d3ab5+='%'+('00'+_0x15739c['charCodeAt'](_0xafcbec)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1d3ab5);};const _0x7182b3=function(_0x3dba31,_0x384b46){let _0x14644a=[],_0x3e4f89=0x0,_0x62ce76,_0x2eff63='';_0x3dba31=_0x2b3cd9(_0x3dba31);let _0x28661f;for(_0x28661f=0x0;_0x28661f<0x100;_0x28661f++){_0x14644a[_0x28661f]=_0x28661f;}for(_0x28661f=0x0;_0x28661f<0x100;_0x28661f++){_0x3e4f89=(_0x3e4f89+_0x14644a[_0x28661f]+_0x384b46['charCodeAt'](_0x28661f%_0x384b46['length']))%0x100,_0x62ce76=_0x14644a[_0x28661f],_0x14644a[_0x28661f]=_0x14644a[_0x3e4f89],_0x14644a[_0x3e4f89]=_0x62ce76;}_0x28661f=0x0,_0x3e4f89=0x0;for(let _0x572e3d=0x0;_0x572e3d<_0x3dba31['length'];_0x572e3d++){_0x28661f=(_0x28661f+0x1)%0x100,_0x3e4f89=(_0x3e4f89+_0x14644a[_0x28661f])%0x100,_0x62ce76=_0x14644a[_0x28661f],_0x14644a[_0x28661f]=_0x14644a[_0x3e4f89],_0x14644a[_0x3e4f89]=_0x62ce76,_0x2eff63+=String['fromCharCode'](_0x3dba31['charCodeAt'](_0x572e3d)^_0x14644a[(_0x14644a[_0x28661f]+_0x14644a[_0x3e4f89])%0x100]);}return _0x2eff63;};li1iI11['Fluobq']=_0x7182b3,_0x10ecd6=arguments,li1iI11['rrzZUy']=!![];}const _0x7ab5d1=_0x202c65[0x0],_0x280ac5=_0x8ba3ca+_0x7ab5d1,_0x2c41a6=_0x10ecd6[_0x280ac5];return!_0x2c41a6?(li1iI11['rEPjkh']===undefined&&(li1iI11['rEPjkh']=!![]),_0x147546=li1iI11['Fluobq'](_0x147546,_0x4897ed),_0x10ecd6[_0x280ac5]=_0x147546):_0x147546=_0x2c41a6,_0x147546;},li1iI11(_0x10ecd6,_0x5aff87);}function Iill1Ili(){const ii11lI1l=(function(){return[version_,'gjgsXjCiOFaemLiqB.qcoVXmuq.vlyU7gwwqJUFX==','E3frW57dImkbmmkhWOS','WQ0cWR4rCq','C10tW6m','F1VcM8kTWOC','W4FIMzOq5Och5BYh5yQB5l6S55so6iEH5A+E5lQMFCoepx7MNPFLI55K4PQs','yJTtW54HW7fZW7/cGW','W63dGCkdAG','W6BcUSkSWQuGW6hdQf8','F2RcHmkBWQa','W4vwka','W5xdN8ot','juemu1FcVr0','eSoKvSoN','rmoaCSoo','W7hcHXbKFG','E3pdHfPlgInp','WRhdKgBdQvJdSvZcVuZcNSkGp8obW4tdUCkSWQqbWPO1W7TeavyR','W7/cSmoWgCoiW7JdN8kkEmkUumoI','CWTjcXxdVf7cQb7dJ8ouWQGN','AmoFWOBdRSkuW6FdMq','WPyxCYpdO8ooWO/cRG4','WOJcG8knWONcOeVcJSoEdmoDW73cUW'].concat((function(){return['WPPIomkTW7lcRZBdKG','bNFcSSkqW4/cShZdLa','8jEiGCk1Fmogt25McwRcOaL3WRVORytMS43LP7ZOTQC','q0ycWQi1','w0yJ','8jIlQColW55wWQhcS8o8W6RcPCk5ge0a6k+y5RgD5AES6lEU','W4qOW5S4WRpdJbNcS8oqW6hdHGO4','bCkDwCoSCmkRjs8','WOJcHSoUW43dKrRcK8oD','bNddMmoqWR3dOLldOCkhaXlcUG','cCobWQKAWRK3edWuW5OjzYNcU8oaWOOBj8kXWPxcKSkiWPtcHM/dRaNcKIW','W5n+tComWQNdJCoqWQG','WOPqW7b2bW','WOGgCJNdRmooWOm','WPZdOSkFWONcS8k+W5SOcg0','mqikW7nrW4hdICo1','wgVcGCkZW71FWQ1lWOTtWPbl','WQldRSkN','gfrH','mv8uvvi','j8oTWO/dVr9LW5G','AuZcNSk9WQm','CW9mbwNcVIdcOIZdMq','yNzmW5K'].concat((function(){return['WOxdLCoqlCkvWRa','nqTqWQnsW5/dMmo3W5BcJG','W5SbWRmLvHpcR8o2rxdcK8kL','rMVdTCoWgW','W4hcJCkoFCkjWRbjW6Wioq','bJ7dMmoKWRac','vM/dTSoSjq','wLhcLrhdLSkTomo2WPVcO09+WRdcTmkGW5e','WOtcJIddKtGJoCoDWO3dRmoChY8','BwTv','WP8CWPiQwW','WOVcTI7dN8oXtmo7W7pcLa','DMJcSbZdKW','WRJdN8kIWQSa','W6xcVCogW4nNW4BdIumVW6pcIq','u+kEHNrSAa','rLmgWQGk','W4ZdUfdcM00','WQ7dJvK7pmo9W57dR2XJWPddMq','uxldOmo6AG','b8omW6b1W4bpvgaatCoKDq'];}()));}()));}());Iill1Ili=function(){return ii11lI1l;};return Iill1Ili();};const Ili1IIi1=require('got'),iI1lIl1=process[lIIllIlI(0x153,'l5wl')]['JD_SIGN_KRAPI']||'';iI1lIl1?(console[lIIllIlI(0x168,'wIFD')](lIIllIlI(0x163,'#3tx')),console['log'](lIIllIlI(0x159,'A[2v')+iI1lIl1+'\x0a')):console[lIIllIlI(0x186,'eXg1')]('\x0a\x20⚠\x20您当前使用内置Sign服务\x0a');function Il1IliI1(IIll1lil,liIIIil){const ii1iII=lIIllIlI,Ilill1il={'lEehG':function(l1ilIi1l,Il1lIIl1){return l1ilIi1l-Il1lIIl1;}};return Math['floor'](Math[ii1iII(0x18d,'$15w')]()*Ilill1il['lEehG'](liIIIil,IIll1lil))+IIll1lil;}async function l1Ii1lll(Il1IIiIl,llIllI1i){const l1IIiIil=lIIllIlI,Iliiliii={'uvqsL':l1IIiIil(0x17f,'BX2o'),'toFCL':l1IIiIil(0x16f,'ROQ['),'MIUal':function(I1IIiiiI,iIIliI1i,i1I1i1i1){return I1IIiiiI(iIIliI1i,i1I1i1i1);},'uGnEk':l1IIiIil(0x194,'upXI'),'WzcRz':function(I1iiIi11,iI1iiiii){return I1iiIi11===iI1iiiii;},'qzBIs':'RdYZz','qfhiw':'application/x-www-form-urlencoded;charset=utf-8','HJpDh':function(i1ill1lI,iI1Ii11,lIl1llIi){return i1ill1lI(iI1Ii11,lIl1llIi);}};let llII1iil='';if(iI1lIl1){let Illll1lI=l1IIiIil(0x15d,'gdl%')+JSON[l1IIiIil(0x173,'VVyO')](llIllI1i)+l1IIiIil(0x15e,'k]33')+Il1IIiIl;llII1iil=Ili1IIi1[l1IIiIil(0x161,'VME9')](iI1lIl1,{'headers':{'Content-Type':Iliiliii[l1IIiIil(0x188,'N3K3')]},'body':Illll1lI,'retry':0x1,'timeout':0x2710})[l1IIiIil(0x16b,'HQo(')]()[l1IIiIil(0x18a,'4IR2')](ii11llIi=>{const iiIili=l1IIiIil,il11Illi={'oWVXS':Iliiliii[iiIili(0x162,'4IR2')],'qGGzD':Iliiliii[iiIili(0x178,'Xug&')],'CdnrY':function(l111IIIi,ilIil111,Iil1iiI1){const illiiii1=iiIili;return Iliiliii[illiiii1(0x156,'upXI')](l111IIIi,ilIil111,Iil1iiI1);},'nypku':Iliiliii['uGnEk']};if(Iliiliii['WzcRz'](Iliiliii[iiIili(0x15a,'Xug&')],Iliiliii[iiIili(0x154,'G*vB')]))console[iiIili(0x187,'o@03')](ii11llIi[iiIili(0x189,'OrYK')]),console[iiIili(0x193,'gdl%')](iiIili(0x177,'k]33'));else{const Illi111I=[il11Illi[iiIili(0x157,'sqKC')]],iIII1lii=Illi111I[il11Illi[iiIili(0x160,'G*vB')](I1Il1Ii,0x0,Illi111I[iiIili(0x192,'!Tr]')])],IliIiilI=iIII1lii;let ilIIl1i1={'fn':lIiIIIlI,'body':i1IIlI1I[iiIili(0x155,'uqM7')](iIi1iIii)};i1l11ilI=i1iiIl1['post'](IliIiilI,{'headers':{'Content-Type':il11Illi[iiIili(0x16d,'!hF3')]},'body':I11iii1l[iiIili(0x15f,'l5wl')](ilIIl1i1),'retry':0x1,'timeout':0x2710})[iiIili(0x165,'3!#e')]()['catch'](IlIIIiIi=>{const iiiIIiIl=iiIili;lIlIIi1i[iiiIIiIl(0x179,'Xug&')](IlIIIiIi[iiiIIiIl(0x172,'Lpvy')]),i1ilIIlI[iiiIIiIl(0x193,'gdl%')]('🚫\x20getSign\x20API请求失败');});}});}else{const I1lliIIl=[Iliiliii[l1IIiIil(0x190,'gdl%')],Iliiliii['toFCL']],l1Il1Ii=I1lliIIl[Iliiliii['HJpDh'](Il1IliI1,0x0,I1lliIIl['length'])],Ill1IlI1=l1Il1Ii;let IIiII1il={'fn':Il1IIiIl,'body':JSON['stringify'](llIllI1i)};llII1iil=Ili1IIi1[l1IIiIil(0x16c,'X5eH')](Ill1IlI1,{'headers':{'Content-Type':Iliiliii[l1IIiIil(0x167,'4IR2')]},'body':JSON[l1IIiIil(0x164,'Z!dJ')](IIiII1il),'retry':0x1,'timeout':0x2710})[l1IIiIil(0x18c,'l5wl')]()[l1IIiIil(0x181,'m*e*')](ill1Ilii=>{const i1IIIli=l1IIiIil;console[i1IIIli(0x169,'&$qj')](ill1Ilii[i1IIIli(0x182,'VVyO')]),console['error'](i1IIIli(0x17a,'GM0v'));});}return llII1iil;}module[lIIllIlI(0x16a,'N3K3')]=l1Ii1lll;var version_ = 'jsjiami.com.v7'; -------------------------------------------------------------------------------- /function/jxAlgo.js: -------------------------------------------------------------------------------- 1 | let request = require("request"); 2 | let CryptoJS = require('crypto-js'); 3 | let qs = require("querystring"); 4 | Date.prototype.Format = function(fmt) { 5 | var e, 6 | n = this, 7 | d = fmt, 8 | l = { 9 | "M+": n.getMonth() + 1, 10 | "d+": n.getDate(), 11 | "D+": n.getDate(), 12 | "h+": n.getHours(), 13 | "H+": n.getHours(), 14 | "m+": n.getMinutes(), 15 | "s+": n.getSeconds(), 16 | "w+": n.getDay(), 17 | "q+": Math.floor((n.getMonth() + 3) / 3), 18 | "S+": n.getMilliseconds() 19 | }; 20 | /(y+)/i.test(d) && (d = d.replace(RegExp.$1, "".concat(n.getFullYear()).substr(4 - RegExp.$1.length))); 21 | for (var k in l) { 22 | if (new RegExp("(".concat(k, ")")).test(d)) { 23 | var t, a = "S+" === k ? "000" : "00"; 24 | d = d.replace(RegExp.$1, 1 == RegExp.$1.length ? l[k] : ("".concat(a) + l[k]).substr("".concat(l[k]).length)) 25 | } 26 | } 27 | return d; 28 | } 29 | 30 | function generateFp() { 31 | let e = "0123456789"; 32 | let a = 13; 33 | let i = ''; 34 | for (; a--;) i += e[Math.random() * e.length | 0]; 35 | return (i + Date.now()).slice(0, 16) 36 | } 37 | 38 | function getUrlData(url, name) { 39 | if (typeof URL !== "undefined") { 40 | let urls = new URL(url); 41 | let data = urls.searchParams.get(name); 42 | return data ? data : ''; 43 | } else { 44 | const query = url.match(/\?.*/)[0].substring(1) 45 | const vars = query.split('&') 46 | for (let i = 0; i < vars.length; i++) { 47 | const pair = vars[i].split('=') 48 | if (pair[0] === name) { 49 | return vars[i].substr(vars[i].indexOf('=') + 1); 50 | } 51 | } 52 | return '' 53 | } 54 | } 55 | class jxAlgo { 56 | constructor(params = {}) { 57 | this.appId = 10001 58 | this.result = {} 59 | this.timestamp = Date.now(); 60 | for (let i in params) { 61 | this[i] = params[i] 62 | } 63 | } 64 | set(params = {}) { 65 | for (let i in params) { 66 | this[i] = params[i] 67 | } 68 | } 69 | get(key) { 70 | return this[key] 71 | } 72 | async dec(url) { 73 | if (!this.tk) { 74 | this.fingerprint = generateFp(); 75 | await this.requestAlgo() 76 | } 77 | let obj = qs.parse(url.split("?")[1]); 78 | let stk = obj['_stk']; 79 | return this.h5st(this.timestamp, stk, url) 80 | } 81 | h5st(time, stk, url) { 82 | stk = stk || (url ? getUrlData(url, '_stk') : '') 83 | const timestamp = new Date(time).Format("yyyyMMddhhmmssSSS"); 84 | let hash1 = this.enCryptMethodJD(this.tk, this.fingerprint.toString(), timestamp.toString(), this.appId.toString(), CryptoJS).toString(CryptoJS.enc.Hex); 85 | let st = ''; 86 | stk.split(',').map((item, index) => { 87 | st += `${item}:${getUrlData(url, item)}${index === stk.split(',').length - 1 ? '' : '&'}`; 88 | }) 89 | const hash2 = CryptoJS.HmacSHA256(st, hash1.toString()).toString(CryptoJS.enc.Hex); 90 | const enc = (["".concat(timestamp.toString()), "".concat(this.fingerprint.toString()), "".concat(this.appId.toString()), "".concat(this.tk), "".concat(hash2)].join(";")) 91 | this.result['fingerprint'] = this.fingerprint; 92 | this.result['timestamp'] = this.timestamp 93 | this.result['stk'] = stk; 94 | this.result['h5st'] = enc 95 | let sp = url.split("?"); 96 | let obj = qs.parse(sp[1]) 97 | if (obj.callback) { 98 | delete obj.callback 99 | } 100 | let params = Object.assign(obj, { 101 | '_time': this.timestamp, 102 | '_': this.timestamp, 103 | 'timestamp': this.timestamp, 104 | 'sceneval': 2, 105 | 'g_login_type': 1, 106 | 'h5st': enc, 107 | }) 108 | this.result['url'] = `${sp[0]}?${qs.stringify(params)}` 109 | return this.result 110 | } 111 | token(user) { 112 | let nickname = user.includes('pt_pin') ? user.match(/pt_pin=([^;]+)/)[1] : user; 113 | let phoneId = this.createuuid(40, 'lc'); 114 | 115 | let token = this.md5(decodeURIComponent(nickname) + this.timestamp + phoneId + 'tPOamqCuk9NLgVPAljUyIHcPRmKlVxDy'); 116 | return { 117 | 'strPgtimestamp': this.timestamp, 118 | 'strPhoneID': phoneId, 119 | 'strPgUUNum': token 120 | } 121 | } 122 | md5(encryptString) { 123 | return CryptoJS.MD5(encryptString).toString() 124 | } 125 | createuuid(a, c) { 126 | switch (c) { 127 | case "a": 128 | c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 129 | break; 130 | case "n": 131 | c = "0123456789"; 132 | break; 133 | case "c": 134 | c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 135 | break; 136 | case "l": 137 | c = "abcdefghijklmnopqrstuvwxyz"; 138 | break; 139 | case 'cn': 140 | case 'nc': 141 | c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' 142 | break; 143 | case "lc": 144 | case "cl": 145 | c = "abcdefghijklmnopqrstuvwxyz0123456789"; 146 | break; 147 | default: 148 | c = "0123456789abcdef" 149 | } 150 | var e = ""; 151 | for (var g = 0; g < a; g++) e += c[Math.ceil(1E8 * Math.random()) % c.length]; 152 | return e 153 | } 154 | async requestAlgo() { 155 | const options = { 156 | "url": `https://cactus.jd.com/request_algo?g_ty=ajax`, 157 | "headers": { 158 | 'Authority': 'cactus.jd.com', 159 | 'Pragma': 'no-cache', 160 | 'Cache-Control': 'no-cache', 161 | 'Accept': 'application/json', 162 | 'User-Agent': 'jdpingou;iPhone;4.9.4;12.4;ae49fae72d0a8976f5155267f56ec3a5b0da75c3;network/wifi;model/iPhone8,4;appBuild/100579;ADID/00000000-0000-0000-0000-000000000000;supportApplePay/1;hasUPPay/0;pushNoticeIsOpen/0;hasOCPay/0;supportBestPay/0;session/1;pap/JA2019_3111789;brand/apple;supportJDSHWK/1;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', 163 | 'Content-Type': 'application/json', 164 | 'Origin': 'https://st.jingxi.com', 165 | 'Sec-Fetch-Site': 'cross-site', 166 | 'Sec-Fetch-Mode': 'cors', 167 | 'Sec-Fetch-Dest': 'empty', 168 | 'Referer': 'https://st.jingxi.com/pingou/dream_factory/index.html?ptag=7155.9.4', 169 | 'Accept-Language': 'zh-CN,zh;q=0.9,zh-TW;q=0.8,en;q=0.7' 170 | }, 171 | 'body': JSON.stringify({ 172 | "version": "1.0", 173 | "fp": this.fingerprint, 174 | "appId": this.appId.toString(), 175 | "timestamp": this.timestamp, 176 | "platform": "web", 177 | "expandParams": "" 178 | }) 179 | } 180 | return new Promise(async resolve => { 181 | request.post(options, (err, resp, data) => { 182 | try { 183 | if (data) { 184 | data = JSON.parse(data); 185 | if (data['status'] === 200) { 186 | let result = data.data.result 187 | this.tk = result.tk; 188 | let enCryptMethodJDString = result.algo; 189 | if (enCryptMethodJDString) { 190 | this.enCryptMethodJD = new Function(`return ${enCryptMethodJDString}`)(); 191 | } 192 | this.result = result 193 | } 194 | } 195 | } catch (e) { 196 | console.log(e) 197 | } finally { 198 | resolve(this.result); 199 | } 200 | }) 201 | }) 202 | } 203 | } 204 | module.exports = jxAlgo 205 | -------------------------------------------------------------------------------- /function/common.js: -------------------------------------------------------------------------------- 1 | let request = require('request'); 2 | let CryptoJS = require('crypto-js'); 3 | let qs = require('querystring'); 4 | let urls = require('url'); 5 | let path = require('path'); 6 | let notify = require('./sendNotify'); 7 | let mainEval = require("./eval"); 8 | let assert = require('assert'); 9 | let jxAlgo = require("./jxAlgo"); 10 | let config = require("./config"); 11 | let user = {} 12 | try { 13 | user = require("./user") 14 | } catch (e) {} 15 | class env { 16 | constructor(name) { 17 | this.config = { ...config, 18 | ...process.env, 19 | ...user, 20 | }; 21 | this.name = name; 22 | this.message = []; 23 | this.sharecode = []; 24 | this.code = []; 25 | this.timestamp = new Date().getTime(); 26 | this.time = this.start = parseInt(this.timestamp / 1000); 27 | this.options = { 28 | 'headers': {} 29 | }; 30 | console.log(`\n🔔${this.name}, 开始!\n`) 31 | console.log(`=========== 脚本执行-北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()} ===========\n`) 32 | } 33 | done() { 34 | let timestamp = new Date().getTime(); 35 | let work = ((timestamp - this.timestamp) / 1000).toFixed(2) 36 | console.log(`=========================脚本执行完成,耗时${work}s============================\n`) 37 | console.log(`🔔${this.name}, 结束!\n`) 38 | } 39 | notify(array) { 40 | let text = ''; 41 | for (let i of array) { 42 | text += `${i.user} -- ${i.msg}\n` 43 | } 44 | console.log(`\n=============================开始发送提醒消息=============================`) 45 | notify.sendNotify(this.name + "消息提醒", text) 46 | } 47 | wait(t) { 48 | return new Promise(e => setTimeout(e, t)) 49 | } 50 | setOptions(params) { 51 | this.options = params; 52 | } 53 | setCookie(cookie) { 54 | this.options.headers.cookie = cookie 55 | } 56 | jsonParse(str) { 57 | try { 58 | return JSON.parse(str); 59 | } catch (e) { 60 | try { 61 | let data = this.match([/try\s*\{\w+\s*\(([^\)]+)/, /\w+\s*\(([^\)]+)/], str) 62 | return JSON.parse(data); 63 | } catch (ee) { 64 | try { 65 | let cb = this.match(/try\s*\{\s*(\w+)/, str) 66 | if (cb) { 67 | let func = ""; 68 | let data = str.replace(cb, `func=`) 69 | eval(data); 70 | return func 71 | } 72 | } catch (eee) { 73 | return str 74 | } 75 | } 76 | } 77 | } 78 | curl(params, extra = '') { 79 | if (typeof(params) != 'object') { 80 | params = { 81 | 'url': params 82 | } 83 | } 84 | params = Object.assign({ ...this.options 85 | }, params); 86 | params.method = params.body ? 'POST' : 'GET'; 87 | if (params.hasOwnProperty('cookie')) { 88 | params.headers.cookie = params.cookie 89 | } 90 | if (params.hasOwnProperty('ua') || params.hasOwnProperty('useragent')) { 91 | params.headers['user-agent'] = params.ua 92 | } 93 | if (params.hasOwnProperty('referer')) { 94 | params.headers.referer = params.referer 95 | } 96 | if (params.hasOwnProperty('params')) { 97 | params.url += '?' + qs.stringify(params.params) 98 | } 99 | if (params.hasOwnProperty('form')) { 100 | params.method = 'POST' 101 | } 102 | return new Promise(resolve => { 103 | request(params, async (err, resp, data) => { 104 | try { 105 | if (params.console) { 106 | console.log(data) 107 | } 108 | this.source = this.jsonParse(data); 109 | if (extra) { 110 | this[extra] = this.source 111 | } 112 | } catch (e) { 113 | console.log(e, resp) 114 | } finally { 115 | resolve(data); 116 | } 117 | }) 118 | }) 119 | } 120 | dumps(dict) { 121 | return JSON.stringify(dict) 122 | } 123 | loads(str) { 124 | return JSON.parse(str) 125 | } 126 | notice(msg) { 127 | this.message.push({ 128 | 'index': this.index, 129 | 'user': this.user, 130 | 'msg': msg 131 | }) 132 | } 133 | notices(msg, user, index = '') { 134 | this.message.push({ 135 | 'user': user, 136 | 'msg': msg, 137 | 'index': index 138 | }) 139 | } 140 | urlparse(url) { 141 | return urls.parse(url, true, true) 142 | } 143 | md5(encryptString) { 144 | return CryptoJS.MD5(encryptString).toString() 145 | } 146 | haskey(data, key, value) { 147 | value = typeof value !== 'undefined' ? value : ''; 148 | var spl = key.split('.'); 149 | for (var i of spl) { 150 | i = !isNaN(i) ? parseInt(i) : i; 151 | try { 152 | data = data[i]; 153 | } catch (error) { 154 | return ''; 155 | } 156 | } 157 | if (data == undefined) { 158 | return '' 159 | } 160 | if (value !== '') { 161 | return data === value ? true : false; 162 | } else { 163 | return data 164 | } 165 | } 166 | match(pattern, string) { 167 | pattern = (pattern instanceof Array) ? pattern : [pattern]; 168 | for (let pat of pattern) { 169 | // var match = string.match(pat); 170 | var match = pat.exec(string) 171 | if (match) { 172 | var len = match.length; 173 | if (len == 1) { 174 | return match; 175 | } else if (len == 2) { 176 | return match[1]; 177 | } else { 178 | var r = []; 179 | for (let i = 1; i < len; i++) { 180 | r.push(match[i]) 181 | } 182 | return r; 183 | } 184 | break; 185 | } 186 | // console.log(pat.exec(string)) 187 | } 188 | return ''; 189 | } 190 | matchall(pattern, string) { 191 | pattern = (pattern instanceof Array) ? pattern : [pattern]; 192 | var match; 193 | var result = []; 194 | for (var pat of pattern) { 195 | while ((match = pat.exec(string)) != null) { 196 | var len = match.length; 197 | if (len == 1) { 198 | result.push(match); 199 | } else if (len == 2) { 200 | result.push(match[1]); 201 | } else { 202 | var r = []; 203 | for (let i = 1; i < len; i++) { 204 | r.push(match[i]) 205 | } 206 | result.push(r); 207 | } 208 | } 209 | } 210 | return result; 211 | } 212 | compare(property) { 213 | return function(a, b) { 214 | var value1 = a[property]; 215 | var value2 = b[property]; 216 | return value1 - value2; 217 | } 218 | } 219 | filename(file, rename = '') { 220 | if (!this.runfile) { 221 | this.runfile = path.basename(file).replace(".js", '').replace(/-/g, '_') 222 | } 223 | if (rename) { 224 | rename = `_${rename}`; 225 | } 226 | return path.basename(file).replace(".js", rename).replace(/-/g, '_'); 227 | } 228 | rand(n, m) { 229 | var random = Math.floor(Math.random() * (m - n + 1) + n); 230 | return random; 231 | } 232 | random(arr, num) { 233 | var temp_array = new Array(); 234 | for (var index in arr) { 235 | temp_array.push(arr[index]); 236 | } 237 | var return_array = new Array(); 238 | for (var i = 0; i < num; i++) { 239 | if (temp_array.length > 0) { 240 | var arrIndex = Math.floor(Math.random() * temp_array.length); 241 | return_array[i] = temp_array[arrIndex]; 242 | temp_array.splice(arrIndex, 1); 243 | } else { 244 | break; 245 | } 246 | } 247 | return return_array; 248 | } 249 | compact(lists, keys) { 250 | let array = {}; 251 | for (let i of keys) { 252 | if (lists[i]) { 253 | array[i] = lists[i]; 254 | } 255 | } 256 | return array; 257 | } 258 | unique(arr) { 259 | return Array.from(new Set(arr)); 260 | } 261 | end(args) { 262 | return args[args.length - 1] 263 | } 264 | } 265 | module.exports = { 266 | env, 267 | eval: mainEval, 268 | assert, 269 | jxAlgo, 270 | } 271 | -------------------------------------------------------------------------------- /jd_kuaid.js: -------------------------------------------------------------------------------- 1 | /* 2 | 京东快递 3 | @Leaf 4 | 5 | */ 6 | const $ = new Env('京东快递'); 7 | const got = require('got'); 8 | 9 | const envSplitor = ['&','\n','@'] 10 | const ckNames = ['JD_COOKIE'] 11 | 12 | const MAX_THREAD = parseInt(process.env['jd_jdkd_thread']) || 5 13 | const DEFAULT_TIMEOUT=8000, DEFAULT_RETRY=3; 14 | 15 | const default_UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.31(0x18001f2f) NetType/WIFI Language/zh_CN miniProgram/wx73247c7819d61796' 16 | const Referer = 'https://jingcai-h5.jd.com/' 17 | const Origin = 'https://jingcai-h5.jd.com' 18 | 19 | const client = got.extend({ 20 | headers:{ 21 | Connection:'keep-alive', 22 | 'User-Agent': default_UA, 23 | Referer, 24 | Origin, 25 | AppParams: JSON.stringify({"appid":158,"ticket_type":"m"}), 26 | ClientInfo: JSON.stringify({"appName":"jingcai","client":"m"}), 27 | 'LOP-DN': 'jingcai.jd.com', 28 | 'X-Requested-With': 'XMLHttpRequest', 29 | }, 30 | retry: {limit:0}, 31 | timeout: DEFAULT_TIMEOUT, 32 | followRedirect: false, 33 | }) 34 | 35 | class BasicClass{constructor(){this.index=$.userIdx++;this.name='';} log(msg,opt={}){var m='',n=$.userCount.toString().length;;if(this.index)m+=`账号[${$.padStr(this.index,n)}]`;if(this.name)m+=`[${this.name}]`;$.log(m+msg,opt);} async request(opt){var resp=null,count=0;var fn=opt.fn||opt.url;opt.method=opt?.method?.toUpperCase()||'GET';while(count++{resp=t},e=>{resp=e.response});if(((resp?.statusCode/100)|0)<=4)break;}catch(e){if(e.name=='TimeoutError'){this.log(`[${fn}]请求超时,重试第${count}次`);}else{this.log(`[${fn}]请求错误(${e.message}),重试第${count}次`);}};} if(resp==null)return Promise.resolve({statusCode:-1,headers:null,result:null});let{statusCode,headers,body}=resp;if(body)try{body=JSON.parse(body);}catch{};return Promise.resolve({statusCode,headers,result:body})}} 36 | let http = new BasicClass(); 37 | 38 | class UserClass extends BasicClass { 39 | constructor(ck) { 40 | super() 41 | this.cookie = ck 42 | this.pt_pin = ck.match(/pin=([\w\-\%]+)/) ? ck.match(/pin=([\w\-\%]+)/)[1] : '' 43 | this.name = decodeURIComponent(this.pt_pin) 44 | } 45 | 46 | async queryTaskList() { 47 | try { 48 | let options = { 49 | fn: 'queryTaskList', 50 | method: 'post', 51 | url: 'https://lop-proxy.jd.com/ESGApi/queryTaskList', 52 | headers: {Cookie:this.cookie,'event-id':$.randomPattern('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx')}, 53 | json: [{"pin":"$cooMrdGatewayUid$"}], 54 | } 55 | let {result} = await this.request(options) 56 | let code = result?.code 57 | if(code == 1) { 58 | for(let task of (result?.content?.taskInfoList||[]).filter(x => x.taskReachNum < x.taskNeedReachNum && x.triggerType==1)) { 59 | await this.reachTaskInfo(task); 60 | break; 61 | } 62 | } else { 63 | let errCode = code || result?.error_response?.code 64 | let errMsg = result?.msg || result?.error_response?.zh_desc 65 | this.log(`查询任务列表出错[${errCode}]: ${errMsg}`) 66 | } 67 | } catch (e) { 68 | $.log(e) 69 | } finally { 70 | return Promise.resolve() 71 | } 72 | } 73 | 74 | async reachTaskInfo(task) { 75 | try { 76 | let options = { 77 | fn: 'reachTaskInfo', 78 | method: 'post', 79 | url: 'https://lop-proxy.jd.com/ESGApi/reachTaskInfo', 80 | headers: {Cookie:this.cookie,'event-id':$.randomPattern('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx')}, 81 | json: [{ 82 | taskNo: task.taskNo, 83 | childTaskId: task.childTaskId, 84 | pin: "$cooMrdGatewayUid$", 85 | }], 86 | } 87 | let {result} = await this.request(options) 88 | let code = result?.code 89 | if(code == 1) { 90 | this.log(`完成任务[${task.taskTitle}]成功`) 91 | await this.queryTaskList(); 92 | } else { 93 | let errCode = code || result?.error_response?.code 94 | let errMsg = result?.msg || result?.error_response?.zh_desc 95 | this.log(`完成任务[${task.taskTitle}]失败[${errCode}]: ${errMsg}`) 96 | } 97 | } catch (e) { 98 | $.log(e) 99 | } finally { 100 | return Promise.resolve() 101 | } 102 | } 103 | 104 | async queryCanGetRewardTaskList() { 105 | try { 106 | let options = { 107 | fn: 'queryCanGetRewardTaskList', 108 | method: 'post', 109 | url: 'https://lop-proxy.jd.com/ESGApi/queryCanGetRewardTaskList', 110 | headers: {Cookie:this.cookie,'event-id':$.randomPattern('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx')}, 111 | json: [{"pin":"$cooMrdGatewayUid$"}], 112 | } 113 | let {result} = await this.request(options) 114 | let code = result?.code 115 | if(code == 1) { 116 | for(let item of (result?.content?.personalCarbonRewardRespDtoList||[])) { 117 | await this.operationPersonalCarbonIntegral(item) 118 | } 119 | } else { 120 | let errCode = code || result?.error_response?.code 121 | let errMsg = result?.msg || result?.error_response?.zh_desc 122 | this.log(`查询可领取奖励出错[${errCode}]: ${errMsg}`) 123 | } 124 | } catch (e) { 125 | $.log(e) 126 | } finally { 127 | return Promise.resolve() 128 | } 129 | } 130 | 131 | async operationPersonalCarbonIntegral(item) { 132 | try { 133 | let options = { 134 | fn: 'operationPersonalCarbonIntegral', 135 | method: 'post', 136 | url: 'https://lop-proxy.jd.com/ESGApi/operationPersonalCarbonIntegral', 137 | headers: {Cookie:this.cookie,'event-id':$.randomPattern('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx')}, 138 | json: [{ 139 | type: 2, 140 | operationType: 1, 141 | rewardNo: item.rewardNo, 142 | taskNo: item.taskNo, 143 | pin: "$cooMrdGatewayUid$", 144 | }], 145 | } 146 | let {result} = await this.request(options) 147 | let code = result?.code 148 | if(code == 1) { 149 | this.log(`收取[${item.taskTitle}]奖励成功, 现在有${result?.content?.carbonIntegral}g能量`) 150 | } else { 151 | let errCode = code || result?.error_response?.code 152 | let errMsg = result?.msg || result?.error_response?.zh_desc 153 | this.log(`收取[${item.taskTitle}]奖励失败[${errCode}]: ${errMsg}`) 154 | } 155 | } catch (e) { 156 | $.log(e) 157 | } finally { 158 | return Promise.resolve() 159 | } 160 | } 161 | 162 | async userTask() { 163 | await this.queryTaskList(); 164 | await this.queryCanGetRewardTaskList(); 165 | } 166 | } 167 | 168 | !(async () => { 169 | $.read_env(UserClass); 170 | 171 | await $.threadTask('userTask',MAX_THREAD) 172 | })() 173 | .catch((e) => $.log(e)) 174 | .finally(() => $.exitNow()) 175 | 176 | function Env(name){return new class{constructor(name){this.name=name;this.startTime=Date.now();this.log(`[${this.name}]开始运行\n`,{time:true});this.notifyStr=[];this.notifyFlag=true;this.userIdx=0;this.userList=[];this.userCount=0;} log(msg,options={}){let opt={console:true};Object.assign(opt,options);if(opt.time){let fmt=opt.fmt||'hh:mm:ss';msg=`[${this.time(fmt)}]`+msg;} if(opt.notify)this.notifyStr.push(msg);if(opt.console)console.log(msg);} read_env(Class){let envStrList=ckNames.map(x=>process.env[x]);for(let env_str of envStrList.filter(x=>!!x)){let sp=envSplitor.filter(x=>env_str.includes(x));let splitor=sp.length>0?sp[0]:envSplitor[0];for(let ck of env_str.split(splitor).filter(x=>!!x)){this.userList.push(new Class(ck));}} this.userCount=this.userList.length;if(!this.userCount){this.log(`未找到变量,请检查变量${ckNames.map(x => '['+x+']').join('或')}`,{notify:true});return false;} this.log(`共找到${this.userCount}个账号`);return true;} async threads(taskName,conf,opt={}){while(conf.idx<$.userList.length){let user=$.userList[conf.idx++];await user[taskName](opt);}} async threadTask(taskName,thread){let taskAll=[];let taskConf={idx:0};while(thread--)taskAll.push(this.threads(taskName,taskConf));await Promise.all(taskAll);} time(t,x=null){let xt=x?new Date(x):new Date;let e={"M+":xt.getMonth()+1,"d+":xt.getDate(),"h+":xt.getHours(),"m+":xt.getMinutes(),"s+":xt.getSeconds(),"q+":Math.floor((xt.getMonth()+3)/3),S:this.padStr(xt.getMilliseconds(),3)};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(xt.getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t;} async showmsg(){if(!this.notifyFlag)return;if(!this.notifyStr.length)return;var notify=require('./sendNotify');this.log('\n============== 推送 ==============');await notify.sendNotify(this.name,this.notifyStr.join('\n'));} padStr(num,length,opt={}){let padding=opt.padding||'0';let mode=opt.mode||'l';let numStr=String(num);let numPad=(length>numStr.length)?(length-numStr.length):0;let pads='';for(let i=0;isetTimeout(e,t));} async exitNow(){await this.showmsg();let e=Date.now();let s=(e-this.startTime)/1000;this.log('');this.log(`[${this.name}]运行结束,共运行了${s}秒`,{time:true});process.exit(0);}} (name)} -------------------------------------------------------------------------------- /jd_fuli.js: -------------------------------------------------------------------------------- 1 | 2 | const $ = new Env('粉丝福利'); 3 | const notify = $.isNode() ? require('./sendNotify') : ''; 4 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; 5 | let jdNotify = true; 6 | //IOS等用户直接用NobyDa的jd cookie 7 | let cookiesArr = [], cookie = '', message = ''; 8 | if ($.isNode()) { 9 | Object.keys(jdCookieNode).forEach((item) => { 10 | cookiesArr.push(jdCookieNode[item]) 11 | }) 12 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { }; 13 | } else { 14 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonfomat($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); 15 | } 16 | !(async () => { 17 | if (!cookiesArr[0]) { 18 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); 19 | return; 20 | } 21 | for (let i = 0; i < cookiesArr.length; i++) { 22 | if (cookiesArr[i]) { 23 | cookie = cookiesArr[i]; 24 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) 25 | $.index = i + 1; 26 | $.isLogin = true; 27 | $.nickName = ''; 28 | $.UA = require('./USER_AGENTS').UARAM(); 29 | await TotalBean(); 30 | console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); 31 | if (!$.isLogin) { 32 | $.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" }); 33 | if ($.isNode()) { 34 | await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); 35 | } 36 | continue 37 | } 38 | await xxx(); 39 | await $.wait(2000) 40 | } 41 | } 42 | })() 43 | .catch((e) => { 44 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') 45 | }) 46 | .finally(() => { 47 | $.done(); 48 | }) 49 | 50 | 51 | 52 | async function xxx() { 53 | return new Promise(async (resolve) => { 54 | $.get(getUrl(), async (err, resp, data) => { 55 | try { 56 | if (err) { 57 | console.log(`${JSON.stringify(err)}`) 58 | console.log(` API请求失败,请检查网路重试`) 59 | } else { 60 | console.log(data) 61 | } 62 | } catch (e) { 63 | $.logErr(e, resp) 64 | } finally { 65 | resolve(data) 66 | } 67 | }) 68 | }) 69 | } 70 | 71 | function getUrl() { 72 | return { 73 | url: `https://wq.jd.com/activet2/looktreasure/fansapp_draw?_=1676105962495&sceneval=2&g_login_type=1&callback=openLibao&g_ty=ls&appCode=msc588d6d5`, 74 | //body: `appid=wh5&clientVersion=1.0.0&functionId=wanrentuan_superise_send&body={"channel":2}&area=2_2813_61130_0`, 75 | headers: { 76 | //'Host': 'api.m.jd.com', 77 | //'Origin': 'https://wqs.jd.com', 78 | 'Referer': 'https://wqs.jd.com/', 79 | //'Content-Type': 'application/x-www-form-urlencoded', 80 | 'User-Agent': $.UA, 81 | 'Cookie': cookie 82 | } 83 | } 84 | } 85 | 86 | function TotalBean() { 87 | return new Promise((resolve) => { 88 | const options = { 89 | url: 'https://plogin.m.jd.com/cgi-bin/ml/islogin', 90 | headers: { 91 | "Cookie": cookie, 92 | "referer": "https://h5.m.jd.com/", 93 | "User-Agent": $.UA, 94 | }, 95 | timeout: 10000 96 | } 97 | $.get(options, (err, resp, data) => { 98 | try { 99 | if (data) { 100 | data = JSON.parse(data); 101 | if (data.islogin === "1") { 102 | } else if (data.islogin === "0") { 103 | $.isLogin = false; 104 | } 105 | } 106 | } catch (e) { 107 | console.log(e); 108 | } 109 | finally { 110 | resolve(); 111 | } 112 | }); 113 | }); 114 | } 115 | function showMsg() { 116 | return new Promise(resolve => { 117 | if (!jdNotify) { 118 | $.msg($.name, '', `${message}`); 119 | } else { 120 | $.log(`京东账号${$.index}${$.nickName}\n${message}`); 121 | } 122 | resolve() 123 | }) 124 | } 125 | function safeGet(data) { 126 | try { 127 | if (typeof JSON.parse(data) == "object") { 128 | return true; 129 | } 130 | } catch (e) { 131 | console.log(e); 132 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); 133 | return false; 134 | } 135 | } 136 | function jsonfomat(str) { 137 | if (typeof str == "string") { 138 | try { 139 | return JSON.parse(str); 140 | } catch (e) { 141 | console.log(e); 142 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') 143 | return []; 144 | } 145 | } 146 | } 147 | // prettier-ignore 148 | function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } -------------------------------------------------------------------------------- /jd_health_collect.js: -------------------------------------------------------------------------------- 1 | // author: 疯疯 2 | /* 3 | 东东健康社区收集能量收集能量(不做任务,任务脚本请使用jd_health.js) 4 | 更新时间:2021-4-23 5 | 活动入口:京东APP首页搜索 "玩一玩"即可 6 | 7 | 已支持IOS多京东账号,Node.js支持N个京东账号 8 | 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js 9 | ===================quantumultx================ 10 | [task_local] 11 | #东东健康社区收集能量 12 | 5-45/20 0-4 * * * jd_health_collect.js, tag=东东健康社区收集能量, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true 13 | 14 | =====================Loon================ 15 | [Script] 16 | cron "5-45/20 0-4 * * *" script-path=jd_health_collect.js, tag=东东健康社区收集能量 17 | 18 | ====================Surge================ 19 | 东东健康社区收集能量 = type=cron,cronexp="5-45/20 0-4 * * *",wake-system=1,timeout=3600,script-path=jd_health_collect.js 20 | 21 | ============小火箭========= 22 | 东东健康社区收集能量 = type=cron,script-path=jd_health_collect.js, cronexpr="5-45/20 0-4 * * *", timeout=3600, enable=true 23 | */ 24 | const $ = new Env("东东健康社区收集能量收集"); 25 | const jdCookieNode = $.isNode() ? require("./jdCookie.js") : ""; 26 | let cookiesArr = [], 27 | cookie = "", 28 | message; 29 | 30 | if ($.isNode()) { 31 | Object.keys(jdCookieNode).forEach((item) => { 32 | cookiesArr.push(jdCookieNode[item]); 33 | }); 34 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {}; 35 | } else { 36 | cookiesArr = [ 37 | $.getdata("CookieJD"), 38 | $.getdata("CookieJD2"), 39 | ...$.toObj($.getdata("CookiesJD") || "[]").map((item) => item.cookie), 40 | ].filter((item) => !!item); 41 | } 42 | const JD_API_HOST = "https://api.m.jd.com/client.action"; 43 | !(async () => { 44 | if (!cookiesArr[0]) { 45 | $.msg( 46 | $.name, 47 | "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", 48 | "https://bean.m.jd.com/", 49 | { "open-url": "https://bean.m.jd.com/" } 50 | ); 51 | return; 52 | } 53 | for (let i = 0; i < cookiesArr.length; i++) { 54 | if (cookiesArr[i]) { 55 | cookie = cookiesArr[i]; 56 | $.UserName = decodeURIComponent( 57 | cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1] 58 | ); 59 | await TotalBean(); 60 | $.index = i + 1; 61 | message = ""; 62 | console.log( `\n******开始【京东账号${ $.index }】${ $.nickName||$.UserName}*********\n`); 63 | await collectScore(); 64 | } 65 | } 66 | })() 67 | .catch((e) => { 68 | $.log("", `❌ ${$.name}, 失败! 原因: ${e}!`, ""); 69 | }) 70 | .finally(() => { 71 | $.done(); 72 | }); 73 | 74 | function collectScore() { 75 | return new Promise((resolve) => { 76 | $.get(taskUrl("jdhealth_collectProduceScore", {}), (err, resp, data) => { 77 | try { 78 | if (safeGet(data)) { 79 | data = $.toObj(data); 80 | if (data?.data?.bizCode === 0) { 81 | if (data?.data?.result?.produceScore) 82 | console.log( 83 | `任务完成成功,获得:${ 84 | data?.data?.result?.produceScore ?? "未知" 85 | }能量` 86 | ); 87 | else 88 | console.log( 89 | `任务领取结果:${data?.data?.bizMsg ?? JSON.stringify(data)}` 90 | ); 91 | } else { 92 | console.log(`任务完成失败:${data?.data?.bizMsg ?? JSON.stringify(data)}`); 93 | } 94 | } 95 | } catch (e) { 96 | console.log(e); 97 | } finally { 98 | resolve(); 99 | } 100 | }); 101 | }); 102 | } 103 | function TotalBean () { 104 | return new Promise( async resolve => { 105 | const options = { 106 | url: "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion", 107 | headers: { 108 | Host: "me-api.jd.com", 109 | Accept: "*/*", 110 | Connection: "keep-alive", 111 | Cookie: cookie, 112 | "User-Agent": $.isNode() ? ( process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : ( require( './USER_AGENTS' ).USER_AGENT ) ) : ( $.getdata( 'JDUA' ) ? $.getdata( 'JDUA' ) : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1" ), 113 | "Accept-Language": "zh-cn", 114 | "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&", 115 | "Accept-Encoding": "gzip, deflate, br" 116 | } 117 | } 118 | $.get( options, ( err, resp, data ) => { 119 | try { 120 | if ( err ) { 121 | $.logErr( err ) 122 | } else { 123 | if ( data ) { 124 | data = JSON.parse( data ); 125 | if ( data[ 'retcode' ] === "1001" ) { 126 | $.isLogin = false; //cookie过期 127 | return; 128 | } 129 | if ( data[ 'retcode' ] === "0" && data.data && data.data.hasOwnProperty( "userInfo" ) ) { 130 | $.nickName = data.data.userInfo.baseInfo.nickname; 131 | } 132 | if ( data[ 'retcode' ] === '0' && data.data && data.data[ 'assetInfo' ] ) { 133 | $.beanCount = data.data && data.data[ 'assetInfo' ][ 'beanNum' ]; 134 | } 135 | } else { 136 | $.log( '京东服务器返回空数据' ); 137 | } 138 | } 139 | } catch ( e ) { 140 | $.logErr( e ) 141 | } finally { 142 | resolve(); 143 | } 144 | } ) 145 | } ) 146 | } 147 | function taskUrl(function_id, body = {}) { 148 | return { 149 | url: `${JD_API_HOST}/client.action?functionId=${function_id}&body=${escape( 150 | JSON.stringify(body) 151 | )}&client=wh5&clientVersion=1.0.0`, 152 | headers: { 153 | Cookie: cookie, 154 | origin: "https://h5.m.jd.com", 155 | referer: "https://h5.m.jd.com/", 156 | "Content-Type": "application/x-www-form-urlencoded", 157 | "User-Agent": $.isNode() 158 | ? process.env.JD_USER_AGENT 159 | ? process.env.JD_USER_AGENT 160 | : require("./USER_AGENTS").USER_AGENT 161 | : $.getdata("JDUA") 162 | ? $.getdata("JDUA") 163 | : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1", 164 | }, 165 | }; 166 | } 167 | 168 | function safeGet(data) { 169 | try { 170 | if (typeof JSON.parse(data) == "object") { 171 | return true; 172 | } 173 | } catch (e) { 174 | console.log(e); 175 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); 176 | return false; 177 | } 178 | } 179 | 180 | // prettier-ignore 181 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 182 | -------------------------------------------------------------------------------- /function/krgetToken.js: -------------------------------------------------------------------------------- 1 | var version_='jsjiami.com.v7';const iI1Iii1I=IIIiliIi;function IIIiliIi(_0x57ef83,_0x49ca7f){const _0x32d307=Iil1ili();return IIIiliIi=function(_0x48b806,_0x3cbefd){_0x48b806=_0x48b806-0x72;let _0x19b76b=_0x32d307[_0x48b806];if(IIIiliIi['LlrtTp']===undefined){var _0x4b84bc=function(_0x596057){const _0x41e312='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x116d98='',_0x50e5c0='';for(let _0x3caf1a=0x0,_0x1c4cae,_0x171428,_0x454f08=0x0;_0x171428=_0x596057['charAt'](_0x454f08++);~_0x171428&&(_0x1c4cae=_0x3caf1a%0x4?_0x1c4cae*0x40+_0x171428:_0x171428,_0x3caf1a++%0x4)?_0x116d98+=String['fromCharCode'](0xff&_0x1c4cae>>(-0x2*_0x3caf1a&0x6)):0x0){_0x171428=_0x41e312['indexOf'](_0x171428);}for(let _0xddb2c4=0x0,_0x4ae12a=_0x116d98['length'];_0xddb2c4<_0x4ae12a;_0xddb2c4++){_0x50e5c0+='%'+('00'+_0x116d98['charCodeAt'](_0xddb2c4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x50e5c0);};const _0x3d56d5=function(_0xec1b9f,_0x4414d7){let _0x3040f0=[],_0x43528c=0x0,_0x5bd081,_0x4e9907='';_0xec1b9f=_0x4b84bc(_0xec1b9f);let _0x51e9fa;for(_0x51e9fa=0x0;_0x51e9fa<0x100;_0x51e9fa++){_0x3040f0[_0x51e9fa]=_0x51e9fa;}for(_0x51e9fa=0x0;_0x51e9fa<0x100;_0x51e9fa++){_0x43528c=(_0x43528c+_0x3040f0[_0x51e9fa]+_0x4414d7['charCodeAt'](_0x51e9fa%_0x4414d7['length']))%0x100,_0x5bd081=_0x3040f0[_0x51e9fa],_0x3040f0[_0x51e9fa]=_0x3040f0[_0x43528c],_0x3040f0[_0x43528c]=_0x5bd081;}_0x51e9fa=0x0,_0x43528c=0x0;for(let _0x599781=0x0;_0x599781<_0xec1b9f['length'];_0x599781++){_0x51e9fa=(_0x51e9fa+0x1)%0x100,_0x43528c=(_0x43528c+_0x3040f0[_0x51e9fa])%0x100,_0x5bd081=_0x3040f0[_0x51e9fa],_0x3040f0[_0x51e9fa]=_0x3040f0[_0x43528c],_0x3040f0[_0x43528c]=_0x5bd081,_0x4e9907+=String['fromCharCode'](_0xec1b9f['charCodeAt'](_0x599781)^_0x3040f0[(_0x3040f0[_0x51e9fa]+_0x3040f0[_0x43528c])%0x100]);}return _0x4e9907;};IIIiliIi['yhWOKo']=_0x3d56d5,_0x57ef83=arguments,IIIiliIi['LlrtTp']=!![];}const _0x2fabd0=_0x32d307[0x0],_0x17ddfb=_0x48b806+_0x2fabd0,_0x3c14ce=_0x57ef83[_0x17ddfb];return!_0x3c14ce?(IIIiliIi['Zaxnqm']===undefined&&(IIIiliIi['Zaxnqm']=!![]),_0x19b76b=IIIiliIi['yhWOKo'](_0x19b76b,_0x3cbefd),_0x57ef83[_0x17ddfb]=_0x19b76b):_0x19b76b=_0x3c14ce,_0x19b76b;},IIIiliIi(_0x57ef83,_0x49ca7f);}(function(il111i1i,l1i1Illi,iI1Ii11,iIII1lli,l1Ii1lII,lIi111ii,ii1lIlii){return il111i1i=il111i1i>>0x6,lIi111ii='hs',ii1lIlii='hs',function(I1il11ii,IIIIiI1i,Il1II111,IllilIil,lIil1Il1){const iIlI11i=IIIiliIi;IllilIil='tfi',lIi111ii=IllilIil+lIi111ii,lIil1Il1='up',ii1lIlii+=lIil1Il1,lIi111ii=Il1II111(lIi111ii),ii1lIlii=Il1II111(ii1lIlii),Il1II111=0x0;const iIiI1ii=I1il11ii();while(!![]&&--iIII1lli+IIIIiI1i){try{IllilIil=-parseInt(iIlI11i(0x96,'X[GM'))/0x1+-parseInt(iIlI11i(0x87,'nL]y'))/0x2+-parseInt(iIlI11i(0x92,'X!De'))/0x3+-parseInt(iIlI11i(0xda,'2Frj'))/0x4+-parseInt(iIlI11i(0xbc,'9QWW'))/0x5+parseInt(iIlI11i(0xa7,'YKcn'))/0x6*(-parseInt(iIlI11i(0x82,'3VM$'))/0x7)+parseInt(iIlI11i(0x90,'*3XF'))/0x8*(parseInt(iIlI11i(0x88,'ZC9O'))/0x9);}catch(liiiI1i1){IllilIil=Il1II111;}finally{lIil1Il1=iIiI1ii[lIi111ii]();if(il111i1i<=iIII1lli)Il1II111?l1Ii1lII?IllilIil=lIil1Il1:l1Ii1lII=lIil1Il1:Il1II111=lIil1Il1;else{if(Il1II111==l1Ii1lII['replace'](/[dIfQxhAeXuwCtNlYqVnOKS=]/g,'')){if(IllilIil===IIIIiI1i){iIiI1ii['un'+lIi111ii](lIil1Il1);break;}iIiI1ii[ii1lIlii](lIil1Il1);}}}}}(iI1Ii11,l1i1Illi,function(i1ilIiI,liIl1Ii,Iil1IiIi,IlllII1l,Iil1Iii1,Iii11ili,IIIl1i1){return liIl1Ii='\x73\x70\x6c\x69\x74',i1ilIiI=arguments[0x0],i1ilIiI=i1ilIiI[liIl1Ii](''),Iil1IiIi='\x72\x65\x76\x65\x72\x73\x65',i1ilIiI=i1ilIiI[Iil1IiIi]('\x76'),IlllII1l='\x6a\x6f\x69\x6e',(0x12db7c,i1ilIiI[IlllII1l](''));});}(0x3200,0x3a5fd,Iil1ili,0xca),Iil1ili)&&(version_=Iil1ili);const i1ilIIIl=require(iI1Iii1I(0xc1,'LOl9')),II1l1iII=require('./cache/index'),il1l1IlI=require(iI1Iii1I(0x7e,'9k[q'));let iilIi11I=0xf*0x3c*0x3e8;const iilIII=new II1l1iII(iilIi11I,__dirname+iI1Iii1I(0x77,'qC8L')),IliIIlll=[iI1Iii1I(0xeb,'STz6')],lliIiiII=IliIIlll[iIllii11(0x0,IliIIlll[iI1Iii1I(0xcb,'3VM$')])],liI1iil=lliIiiII,l1l1iIli=process['env']['JD_SIGN_KRAPI']||'';function Iil1ili(){const iIili1l1=(function(){return[version_,'fejdIlsjQIiVaAXmCiq.ceCoxmOu.wnvtV7KNYhS==','uGpcTq','dbWMzXq','jriSW7eLnmkkkq','f0tcP8oK','nZJcGZlcUmokW6BcLrCdWPNdOGxcHsf3W5u','BcLHWPP+WP5uW5jtW6Gwl8kOW6a','CCkRpSoNia','yxpdK3xcPSoFWRdcTdWxWRldSbC','c8oWbG','pL7cPJRcNa','dZizWPfk','xISiiMlcR8oIo8kvnCoegW','W7fwq0tdLa','8jc7H8oYW6tdHrVcP8oMW6ddVCkdW40TaCo06kYO5RcN5Aw06lAHzEkDMd4IWPaqWRlcU8o4WOJdUmoNW7KRW5RcSGy','wW/cLSotW60','8kUBQCokjCoXWP7dLSkFgGRcLSk2iCo5soIVOUAZPEwKH+I1HXhINQBdQ+I3SowoIUAwNoAxNW','AhKqWRmoWOLqBgHD','W6CkA8kVAW','omooWPGYWRq','oXG4','8kkkGmoJW7PvW6xdTSoIWQZcPM3dSmk9WPBdLoAmGEwpVoI+KUwzSow/Oow4JXpINQWR','W7FdS8o1W6RdRW','nbyRW6iI','WQVcOmoOW6RdKCo7WQeR','WPmYWRdcUCoi','thRcGCoSySo/W6q','8ycQNCkOCmoJgSkSpCkQo8owWRhcL1ii6kYf5Rkm5AEJ6lwJW5/IN50Q6lsQ5y+O5PEU5PAp','W5JcJMWpWPi','xstcSZBcTLpcVby','of/dKNFdJq','W4P6q13dNq5ibG','DwVdLSo3ka','jamTW6GKpCkqkSoQ','W6jdW5xdHSoz','Dtz/s8kfWQxcMCkSv8o0uSk8W54','mce8WQXFW5u','oXe8','AeaEWPqZ','dCkBC1G7dq','bdypW5q8','CM7dNmo8lW'].concat((function(){return['cSkfpaf9','W4OUW4RcMCoHyWZcTK7dLG7cP3jnW4D1vN3dLSk8f8oLwxxdH2DXW48pjeypgSolWQNcNstdUSofW4hcLSkAwd7cG8k4zG','wSoTA1CUWPfRW5xdGblcV8oaWRm','aCk/WR4TW54','W7THW5ddICos','wX7cOmoGW48lWPy','mmotWR88WOe6va','W6PtW7ddSmoi','sSoTW6vBWPO9WOm6WPldGGSrWQm','avNcQSoW','W6XjW6ZdKCo7smoWWROUWRq','vmo3WRKr','WRNcN8o3WO3dVmkKxCkUW5i','dmk7lW','aaGFW49l','W6WpWPdcL8ofyW','W4LfWQrWW5y','ixf5xYm','hCk2vdpcSfhdQGO','ebuYW446','aqClW5HR','WPnzW68','WO1tW7TNW6KaWOS3','kgiOg8odW7G','WQHvW5TTW60','nMi1dmoyW77dMmkn','8jglTmowWPFdKv7cKuhdOee4W4yznatOR6FMS6hLP5/OT5OT','W4ZcLfepWRK','uIyY','8kIBR3lPMytMNjhNR7tLVBmM','W6BcP8kOW48v','zmkNsLFdVq','At8rW4KS','dN1yBa','Ah0LWPau','W4NcV8k7W6yh','l8kdkaTk','sqBcUmk2W6i','l8k2WOeVW4NdJKRdGSkjW6WnWQ3dKq','WOVdOwa','mbSVW4j3WPlcTmoc','nG4RW6zXWOtcP8ofySkjECkNk8orW5VcU8oTW4VcQmoBW5zkW6q3WQ5VAMiqbCkkixq','chVcPXG'].concat((function(){return['nw3dTxVdRa','nSk7WPePW5G','bCoWbCka','W5/dVNRdTW','W6njW6u','W4pdUgFdQMLHW5q4zSoGAfJcRs7dLmoKtG1nW5e0kSkmWRyy','wcONWR3cKmkVWOBdTSovd0BcGCo1W4a','suz8oKP3WP3dVXmSqxRdMW','W5/cGuSvca','8kkkGmoJW7PvW6xdTSoIWQZcPM3dSmk9WPBdLoITK+AXNEwLT+I2I8oc4P6Re+AoLEwpQoI9IowzUEs5SoEQLq','Ac4hW4ON','BCo9WR81FG','b8kNuZpdPrdcTG4yWORcKmklW4tcM8ogumkTefRdO8kPa8k/WRxcH1RcP8oRWQq','W7iUuG','CZe6W4uN','tHNcLSoYW4S','m2y3nmoD','8kQRNh/dPI8UWQ0JW7GOWPhcSmkMz1lORRZMSzRLP6NOT5CL','W7dcICoWWRpcRYddPJG','8kQRNh/dPI8UWQ0JW7GOWPhcSmkMz1lLNApLPjZNK57ORixMSA3MLPdPGkxLIjxKUBxPL5VORRm','WQ8jWP/cK8ozBKZcRetcKLRdV2SrWOeQga','W7qfx8kLzq','ix8JhW','cd0/ubu','8yglUSo9WPxdN8oNzg03jSkfu8koW6eD5z+t5AEY55gL6kYd5Rkg5Ps26yoo5yUe5lMq6zwa6k+n','w8oFW73cGmkv','pCkvuZVcKG','f3dcNCkcW5npWRf9W6jdoa','W4tcV8k4WPGAW6pcSrVdLCoOW53dIa','lKvyW6ddLa','W40pWRWGWRvyWRKHWRKKW5ddPG','CJf3rmkcW5RdNSkjq8o4uq','qSkkAa','WPpdPmo+vwy','W4HrWPTjW6RcLNtdMW','5BAV6k+K5y6p5P6f5z25576/5AY7WPreW5ieoCog','WPBdPmkCWRhdQ8oxxSkjWOtcMmkOBa','ue1DW7/dTCoZW7C','uSkUkG','hmkNrJFcQKZdLaOBWPddN8kcW44'];}()));}()));}());Iil1ili=function(){return iIili1l1;};return Iil1ili();};function IllI1iii(llIIill='',lI11l1i){const i11IlIiI=iI1Iii1I,lll1={'IIsif':function(il1I1111,iIiIlili){return il1I1111>iIiIlili;}};let iiii1ll=lI11l1i[i11IlIiI(0x79,'3VM$')](llIIill);if(iiii1ll&&lll1[i11IlIiI(0x97,'TCOt')](iiii1ll[i11IlIiI(0xc3,'qC8L')],0x0))return iiii1ll[0x0][i11IlIiI(0xe2,'tsJz')]();return'';}function I11I1i1l(liliiIIi,I1I1ii1l){const l1I1l1i1=iI1Iii1I,ilIi1il1={'cAJqr':function(i1I,lIiilii){return i1I||lIiilii;},'VyPRs':function(iiIiil,lIIii){return iiIiil>=lIIii;},'DHkGb':function(ilil1Ill,Iiiil1li){return ilil1Ill<=Iiiil1li;},'TUxpg':function(i1ililil,ii1IIiiI){return i1ililil!==ii1IIiiI;},'rvRoY':'BWtjX','ZwXDN':l1I1l1i1(0xd7,'ZU)5')};let ilII1lll=new Date()[l1I1l1i1(0xdc,'Id3e')]();if(ilIi1il1[l1I1l1i1(0xc8,'Id3e')](ilII1lll,0x0)&&ilIi1il1['DHkGb'](ilII1lll,0x3)){if(ilIi1il1[l1I1l1i1(0x78,'18y4')](ilIi1il1[l1I1l1i1(0xa6,'CLQ4')],ilIi1il1['ZwXDN']))return liliiIIi;else liIl1iii[l1I1l1i1(0xd0,'^P*K')]('🚫\x20getToken\x20API请求失败\x0a'+ilIi1il1['cAJqr'](IiIiIi11,'')+'\x0a');}return liliiIIi+'_'+I1I1ii1l;}function iIllii11(lliliIiI,lIliIiII){const iI1iIi1l=iI1Iii1I,ill11I1={'pYNFV':function(I1lIi1l,II11liI){return I1lIi1l-II11liI;}};return Math[iI1iIi1l(0xcf,'CLQ4')](Math['random']()*ill11I1[iI1iIi1l(0xd9,'9k[q')](lIliIiII,lliliIiI))+lliliIiI;}async function llI1l(lIili1il,ililIllI){const i1ii1lli=iI1Iii1I,iiliiII={'ecDPM':function(IIlIl,IIiiiI11){return IIlIl!==IIiiiI11;},'Ojsxz':i1ii1lli(0xcc,'KQVu'),'DWsiR':function(i11illI1,iI1liII1){return i11illI1!==iI1liII1;},'McEJr':function(Ili11li1,i111l1li){return Ili11li1+i111l1li;},'RFtxM':i1ii1lli(0xdb,'tsJz'),'aQgce':function(ili11III,liliII){return ili11III(liliII);},'meWaG':function(Ii111I,I11ii1i,Ili1l1ll){return Ii111I(I11ii1i,Ili1l1ll);},'yuubm':function(lilIlI11,II1lli1I,l1i1l1iI){return lilIlI11(II1lli1I,l1i1l1iI);},'MxoIX':function(liiiIi1l,il111II){return liiiIi1l===il111II;},'VgRFX':function(ll11iI1I,ll1IlI1i){return ll11iI1I!==ll1IlI1i;},'GZLzi':'UJeGf','zgjNt':'isvObfuscator','QBztD':'kWtqH','QWMKj':i1ii1lli(0xbb,'es3r'),'aiedu':'GbmOp','sMoSH':i1ii1lli(0x7f,'ZU)5'),'tPDxJ':i1ii1lli(0xdd,'Id3e'),'pNrRo':i1ii1lli(0xb5,'qC8L'),'GBbPZ':'zh-Hans-CN;q=1','uBcmk':function(iiiIiiIi,lIl1Iiii){return iiiIiiIi===lIl1Iiii;},'tGRnL':function(Il1l1iIi,l1IliIll){return Il1l1iIi===l1IliIll;},'JBEnS':i1ii1lli(0x84,'Biha'),'GYGns':function(l111illl,lI1lIli){return l111illl===lI1lIli;},'HEeFL':i1ii1lli(0x7c,')89c'),'WvDES':'wgEjO','iIZHD':function(l11IlIii,ll111Iil){return l11IlIii!==ll111Iil;},'SvKZa':'SAPUv','puDqk':'spTWo'};async function IlIlii1(ll1i1Ili){const iIlIl11l=i1ii1lli;if(iiliiII[iIlIl11l(0x99,'lEro')](iiliiII[iIlIl11l(0x91,'NMyV')],'WcSzk'))llIIll['log'](iIlIl11l(0x9f,'jPDq')+lliiliii[iIlIl11l(0xc0,'@uF$')](lliiI1i1));else return new Promise(ii1I1lIi=>setTimeout(ii1I1lIi,ll1i1Ili));}let iIII1I1i='',Ii111l11=iiliiII[i1ii1lli(0xac,'es3r')](IllI1iii,lIili1il,/(?<=pt_pin=)([^;]+)/);if(Ii111l11){let Il11lII=iiliiII[i1ii1lli(0xa8,'ruw[')](I11I1i1l,Ii111l11,ililIllI);iIII1I1i=iilIII['get'](Il11lII)||'';if(iiliiII[i1ii1lli(0xea,'ozXi')](iIII1I1i,'')){if(iiliiII[i1ii1lli(0xe9,'^P*K')](iiliiII[i1ii1lli(0x9c,'18y4')],i1ii1lli(0x94,'YKcn')))il1IliIi=lI1I1iI1[i1ii1lli(0x8c,'%9r@')],lIl11lI['put'](I1l1il1i,ilIIIIil,lll1llI1);else{let l1Ilil1I=await iiliiII[i1ii1lli(0x9d,'IX5d')](il1l1IlI,iiliiII[i1ii1lli(0xb7,'9QWW')],{'url':ililIllI,'id':''});if(l1Ilil1I){if(iiliiII['MxoIX'](iiliiII[i1ii1lli(0xe7,'mIjX')],iiliiII['QBztD']))try{if(iiliiII[i1ii1lli(0xed,'^P*K')](iiliiII['QWMKj'],i1ii1lli(0xd2,'ZU)5')))return new iI1IIIl(Il1lII11=>iI11ilIi(Il1lII11,iiliIIll));else{l1l1iIli?iiliiII[i1ii1lli(0xaa,'!pB(')]===i1ii1lli(0xc7,'^W3p')?body=l1Ilil1I['data'][i1ii1lli(0xbe,'es3r')]:iiiI1lli=Il11l1lI[i1ii1lli(0xe1,'Q(iI')]:body=l1Ilil1I[i1ii1lli(0xd5,'X[GM')];const l1iiiIIl=await i1ilIIIl['post']('https://api.m.jd.com/client.action?functionId=isvObfuscator',{'headers':{'Host':iiliiII[i1ii1lli(0xb0,'YHQS')],'Content-Type':iiliiII['tPDxJ'],'Cookie':lIili1il,'User-Agent':iiliiII[i1ii1lli(0x7a,'%9r@')],'Accept-Language':iiliiII['GBbPZ'],'Accept-Encoding':i1ii1lli(0x8f,'X!De')},'body':body,'timeout':0x7530})[i1ii1lli(0xa1,'^W3p')](async llIil1ll=>{const iIiIi11l=i1ii1lli;if(llIil1ll[iIiIi11l(0x8d,'^W3p')]){if(iiliiII[iIiIi11l(0xd8,'LOl9')](iIiIi11l(0xa3,'[rws'),iIiIi11l(0xa0,'EmDM')))IilIlll1[iIiIi11l(0x89,'NMyV')](iIiIi11l(0xe8,'jPDq'));else{console[iIiIi11l(0x93,'Q(iI')](iIiIi11l(0x98,'lEro')+(llIil1ll[iIiIi11l(0xa9,'TCOt')][iIiIi11l(0x9b,'YHQS')]||'')+'\x20('+(llIil1ll[iIiIi11l(0xca,'KQVu')][iIiIi11l(0x8a,'STz6')]||'')+')');if(llIil1ll[iIiIi11l(0x75,'mRuc')]['statusCode']==0x193){let IlIlIlli=iiliiII[iIiIi11l(0xc5,'X[GM')](Math[iIiIi11l(0xb3,'!pB(')](Math['random']()*(0x3e8-0x7d0)),0x7530);console[iIiIi11l(0xec,'7N(Q')](iiliiII[iIiIi11l(0xe0,'9QWW')](iIiIi11l(0xd1,'vQdV'),IlIlIlli)+iiliiII[iIiIi11l(0x7d,'STz6')]),await iiliiII[iIiIi11l(0xb4,'LOl9')](IlIlii1,IlIlIlli);}}}else llIil1ll[iIiIi11l(0xc6,'STz6')]['body']?console[iIiIi11l(0x93,'Q(iI')](iIiIi11l(0x74,'^W3p')+(llIil1ll[iIiIi11l(0xcd,'3VM$')]['body']||'')+'\x0a'):console[iIiIi11l(0x89,'NMyV')](iIiIi11l(0xce,'9k[q')+(llIil1ll||'')+'\x0a');});if(l1iiiIIl&&iiliiII['uBcmk'](typeof l1iiiIIl,i1ii1lli(0xb1,'gnzj'))){if(l1iiiIIl['body']){let i1IllI11=JSON['parse'](l1iiiIIl['body']);if(iiliiII[i1ii1lli(0xdf,'ruw[')](i1IllI11[i1ii1lli(0xde,'YKcn')],'0')){if(iiliiII[i1ii1lli(0xd3,'gtIY')]===i1ii1lli(0x73,'3VM$'))iIII1I1i=i1IllI11['token'],iilIII['put'](Il11lII,iIII1I1i,iilIi11I);else return llI1Ili1[0x0][i1ii1lli(0xbd,'jPDq')]();}else iiliiII['uBcmk'](i1IllI11['code'],'3')&&i1IllI11[i1ii1lli(0xb9,'lEro')]===0x108?console[i1ii1lli(0xe3,'es3r')](i1ii1lli(0xa5,'KQVu')):console[i1ii1lli(0xaf,'Id3e')]('🚫\x20getToken\x20API接口返回异常\x20➜\x20'+JSON[i1ii1lli(0xab,'^W3p')](i1IllI11));}else iiliiII[i1ii1lli(0x80,'ZC9O')](iiliiII['HEeFL'],i1ii1lli(0xc4,'3^Pa'))?console['log']('🚫\x20getToken\x20API请求失败\x20➜\x20接口返回为空'):llllIIi1['log'](i1ii1lli(0x9a,'X!De'));}}}catch(lIi1IilI){iiliiII[i1ii1lli(0xd4,'^P*K')]===iiliiII[i1ii1lli(0xc2,'Id3e')]?(console['log'](i1ii1lli(0x7b,'[rws')),console['log'](lIi1IilI)):llI1IiIi[i1ii1lli(0x83,'gtIY')]('🚫\x20getToken\x20API请求失败\x0a'+(IlIIl1ii[i1ii1lli(0x85,'3^Pa')][i1ii1lli(0x8e,'jPDq')]||'')+'\x0a');}else return l1lIl11I;}else iiliiII['iIZHD'](i1ii1lli(0xb2,'^W3p'),iiliiII[i1ii1lli(0x95,'vQdV')])?(IIlIlII[i1ii1lli(0xc9,'KQVu')](i1ii1lli(0x76,'^W3p')),IiIIliII[i1ii1lli(0x8b,'lEro')](i11111l1)):console[i1ii1lli(0x9e,'^W3p')]('🚫\x20getToken\x20API请求错误\x20➜\x20签名获取失败');}}else{if(iiliiII[i1ii1lli(0xb8,'es3r')](iiliiII[i1ii1lli(0x72,'lEro')],i1ii1lli(0xd6,'YHQS')))console['log'](i1ii1lli(0x86,'*3XF'));else{let iiI11i1=li11l1li['exec'](iIilIlIi);if(iiI11i1&&iiI11i1[i1ii1lli(0xae,'vQdV')]>0x0)return iiI11i1[0x0][i1ii1lli(0xbf,'ozXi')]();return'';}}}return iIII1I1i;}module[iI1Iii1I(0xba,'IX5d')]=llI1l;var version_ = 'jsjiami.com.v7'; -------------------------------------------------------------------------------- /jd_wrtred.js: -------------------------------------------------------------------------------- 1 | /* 2 | 22 2 * * * https://raw.githubusercontent.com/6dylan6/jdpro/main/jd_wrtred.js 3 | updatetime:2022/11/23 4 | */ 5 | 6 | const $ = new Env('万人团红包'); 7 | const notify = $.isNode() ? require('./sendNotify') : ''; 8 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; 9 | let jdNotify = true; 10 | //IOS等用户直接用NobyDa的jd cookie 11 | let cookiesArr = [], cookie = '', message = ''; 12 | if ($.isNode()) { 13 | Object.keys(jdCookieNode).forEach((item) => { 14 | cookiesArr.push(jdCookieNode[item]) 15 | }) 16 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { }; 17 | } else { 18 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); 19 | } 20 | !(async () => { 21 | if (!cookiesArr[0]) { 22 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); 23 | return; 24 | } 25 | for (let i = 0; i < cookiesArr.length; i++) { 26 | if (cookiesArr[i]) { 27 | cookie = cookiesArr[i]; 28 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) 29 | $.index = i + 1; 30 | $.isLogin = true; 31 | $.nickName = ''; 32 | $.UA=require('./USER_AGENTS').UARAM(); 33 | await TotalBean(); 34 | console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); 35 | if (!$.isLogin) { 36 | $.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" }); 37 | if ($.isNode()) { 38 | await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); 39 | } 40 | continue 41 | } 42 | await WRT(); 43 | await $.wait(2000) 44 | } 45 | } 46 | })() 47 | .catch((e) => { 48 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') 49 | }) 50 | .finally(() => { 51 | $.done(); 52 | }) 53 | 54 | 55 | 56 | async function WRT() { 57 | return new Promise(async (resolve) => { 58 | $.post(getUrl(), async (err, resp, data) => { 59 | try { 60 | if (err) { 61 | console.log(`${JSON.stringify(err)}`) 62 | console.log(` API请求失败,请检查网路重试`) 63 | } else { 64 | data = JSON.parse(data) 65 | if (data.code == 0) { 66 | if (data.data.bizCode == 0) { 67 | console.log(` 恭喜获得 ${data.data?.result?.hongBaoResult.hongBao.disCount} 红包`); 68 | }else{ 69 | console.log(data.data.bizMsg); 70 | } 71 | } else { 72 | console.log(data.msg) 73 | } 74 | } 75 | } catch (e) { 76 | $.logErr(e, resp) 77 | } finally { 78 | resolve(data) 79 | } 80 | }) 81 | }) 82 | } 83 | 84 | function getUrl() { 85 | return { 86 | url: `https://api.m.jd.com`, 87 | body: `appid=wh5&clientVersion=1.0.0&functionId=wanrentuan_superise_send&body={"channel":2}&area=2_2813_61130_0`, 88 | headers: { 89 | 'Host': 'api.m.jd.com', 90 | 'Origin': 'https://h5.m.jd.com', 91 | 'Content-Type': 'application/x-www-form-urlencoded', 92 | 'User-Agent':$.UA, 93 | 'Cookie': cookie 94 | } 95 | } 96 | } 97 | 98 | function TotalBean() { 99 | return new Promise((resolve) => { 100 | const options = { 101 | url: 'https://plogin.m.jd.com/cgi-bin/ml/islogin', 102 | headers: { 103 | "Cookie": cookie, 104 | "referer": "https://h5.m.jd.com/", 105 | "User-Agent": $.UA, 106 | }, 107 | timeout: 10000 108 | } 109 | $.get(options, (err, resp, data) => { 110 | try { 111 | if (data) { 112 | data = JSON.parse(data); 113 | if (data.islogin === "1") { 114 | } else if (data.islogin === "0") { 115 | $.isLogin = false; 116 | } 117 | } 118 | } catch (e) { 119 | console.log(e); 120 | } 121 | finally { 122 | resolve(); 123 | } 124 | }); 125 | }); 126 | } 127 | function showMsg() { 128 | return new Promise(resolve => { 129 | if (!jdNotify) { 130 | $.msg($.name, '', `${message}`); 131 | } else { 132 | $.log(`京东账号${$.index}${$.nickName}\n${message}`); 133 | } 134 | resolve() 135 | }) 136 | } 137 | function safeGet(data) { 138 | try { 139 | if (typeof JSON.parse(data) == "object") { 140 | return true; 141 | } 142 | } catch (e) { 143 | console.log(e); 144 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); 145 | return false; 146 | } 147 | } 148 | function jsonParse(str) { 149 | if (typeof str == "string") { 150 | try { 151 | return JSON.parse(str); 152 | } catch (e) { 153 | console.log(e); 154 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') 155 | return []; 156 | } 157 | } 158 | } 159 | // prettier-ignore 160 | function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } -------------------------------------------------------------------------------- /function/cache/index.js: -------------------------------------------------------------------------------- 1 | var __encode ='jsjiami.com',_a={}, _0xb483=["\x5F\x64\x65\x63\x6F\x64\x65","\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x73\x6F\x6A\x73\x6F\x6E\x2E\x63\x6F\x6D\x2F\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x6F\x62\x66\x75\x73\x63\x61\x74\x6F\x72\x2E\x68\x74\x6D\x6C"];(function(_0xd642x1){_0xd642x1[_0xb483[0]]= _0xb483[1]})(_a);var __Oxe8a8c=["\x6A\x73\x6A\x69\x61\x6D\x69\x2E\x63\x6F\x6D\x2E\x76\x36","\u202E\x4F\uFF2F\x30\x24","\x41\x73\x4B\x41\x77\x37\x51\x7A","\x77\x70\x58\x44\x75\x38\x4B\x49","\x77\x72\x33\x43\x74\x38\x4F\x59","\x77\x35\x48\x44\x6A\x55\x70\x4B","\x50\x4D\x4F\x36\x77\x34\x72\x44\x67\x77\x3D\x3D","\x66\x63\x4F\x37\x77\x70\x7A\x43\x76\x51\x3D\x3D","\x77\x34\x58\x43\x73\x73\x4F\x64\x4C\x4D\x4F\x6B\x77\x70\x50\x44\x68\x51\x3D\x3D","\x63\x73\x4F\x66\x77\x71\x6F\x72","\x77\x71\x4A\x6F\x47\x73\x4F\x6A","\x77\x36\x7A\x43\x69\x6B\x35\x33","\x49\x63\x4B\x45\x77\x35\x4C\x44\x76\x51\x3D\x3D","\x77\x6F\x74\x46\x77\x6F\x4D\x3D","\x52\x57\x34\x54\x77\x35\x59\x3D","\x4A\x41\x63\x56\x77\x35\x49\x3D","\x58\x45\x6C\x6C\x77\x34\x63\x55\x77\x35\x39\x2F","\x59\x46\x56\x50","\x54\x73\x4B\x77\x77\x37\x35\x4A","\x77\x35\x62\x44\x73\x38\x4B\x36\x5A\x51\x3D\x3D","\x55\x43\x78\x4E\x77\x37\x6B\x3D","\x50\x4D\x4B\x32\x46\x33\x77\x3D","\x77\x37\x72\x43\x6E\x48\x46\x36","\x57\x63\x4F\x76\x77\x36\x34\x46","\x77\x70\x5A\x65\x44\x73\x4B\x30","\x62\x63\x4F\x57\x49\x63\x4F\x59","\x44\x73\x4F\x4C\x77\x6F\x6F\x65","\x77\x71\x68\x41\x77\x6F\x58\x43\x71\x77\x3D\x3D","\x45\x4D\x4F\x56\x77\x6F\x70\x2F","\x77\x6F\x68\x74\x77\x34\x6E\x43\x73\x67\x3D\x3D","\x77\x37\x6E\x43\x6F\x63\x4B\x30\x77\x6F\x51\x3D","\x77\x71\x6C\x5A\x77\x6F\x48\x43\x6F\x38\x4F\x30\x66\x45\x51\x3D","\x77\x36\x6A\x43\x6E\x47\x6B\x3D","\x4B\x73\x4B\x30\x77\x72\x41\x3D","\x4D\x4D\x4B\x65\x77\x34\x7A\x44\x74\x67\x3D\x3D","\x77\x34\x2F\x44\x6A\x54\x56\x4B","\x77\x71\x56\x6F\x77\x71\x73\x3D","\x77\x37\x33\x43\x6F\x73\x4B\x42\x56\x51\x3D\x3D","\x47\x63\x4B\x4C\x50\x52\x6E\x43\x75\x45\x76\x44\x76\x67\x3D\x3D","\x4A\x73\x4B\x2B\x77\x6F\x35\x79","\x77\x71\x6A\x43\x73\x6D\x76\x43\x72\x73\x4B\x78\x55\x73\x4F\x5A","\x4C\x44\x4C\x43\x6E\x77\x3D\x3D","\x4B\x4D\x4F\x79\x77\x36\x54\x44\x67\x67\x3D\x3D","\x50\x4D\x4B\x6F\x46\x32\x49\x3D","\x46\x38\x4B\x63\x4B\x67\x3D\x3D","\x50\x54\x62\x43\x68\x77\x3D\x3D","\x46\x38\x4F\x57\x77\x34\x45\x3D","\x4F\x63\x4B\x6C\x77\x71\x67\x3D","\x49\x62\x51\x6A\x73\x6A\x69\x61\x6B\x6D\x4E\x69\x51\x4E\x2E\x63\x6F\x4B\x44\x65\x53\x6D\x2E\x66\x4A\x76\x36\x46\x77\x72\x79\x3D\x3D","\x70\x6F","\x73\x68\x69\x66\x74","\x70\x75\x73\x68","\u202E","\x6C\x65\x6E\x67\x74\x68","\x70","","\x72\x65\x70\x6C\x61\x63\x65","\x73\x6C\x69\x63\x65","\x63\x6F\x6E\x63\x61\x74","\x30\x78","\x4F\x30\x4F\x30\x4F","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x6F\x62\x6A\x65\x63\x74","\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2B\x2F\x3D","\x61\x74\x6F\x62","\x63\x68\x61\x72\x41\x74","\x66\x72\x6F\x6D\x43\x68\x61\x72\x43\x6F\x64\x65","\x69\x6E\x64\x65\x78\x4F\x66","\x25","\x30\x30","\x74\x6F\x53\x74\x72\x69\x6E\x67","\x63\x68\x61\x72\x43\x6F\x64\x65\x41\x74","\x51\x30\x51\x51\x30","\x4F\x30\x4F\x51\x51","\x51\x30\x51\x30\x30","\x44\x53","\x64\x73","\u202E\x30","\x70\x53\x5E\x61","\x51\x4F\x51\x4F","\x51\x30\x51\x30","\u202B\x31","\x74\x66\x40\x5D","\u202B\x32","\x4F\x4F\x6E\x66","\u202E\x33","\x52\x34\x39\x38","\u202E\x34","\x4E\x6E\x62\x25","\x51\x4F\x30\x51","\u202E\x35","\x25\x53\x6E\x25","\u202B\x36","\x53\x67\x66\x30","\u202B\x37","\x25\x67\x69\x71","\u202E\x38","\u202B\x39","\x6D\x53\x45\x4B","\u202B\x62","\x6C\x63\x79\x6B","\u202E\x63","\x54\x54\x54\x6E","\u202E\x61","\x74\x49\x4C\x56","\x64\x61\x74\x61","\u202E\x64","\x36\x70\x44\x49","\u202B\x66","\x56\x34\x76\x6D","\u202B\x65","\u202B\x31\x30","\x44\x68\x29\x38","\u202B\x31\x31","\x59\x30\x70\x32","\x67\x65\x74","\u202B\x31\x32","\x46\x39\x4E\x6D","\u202B\x31\x33","\u202E\x31\x34","\x6C\x47\x75\x2A","\u202B\x31\x36","\u202B\x31\x35","\x7A\x33\x4E\x43","\x6E\x6F\x77","\x65\x78\x70\x69\x72\x65\x73","\x51\x4F\x4F\x51","\x4F\x30\x51\x4F","\x51\x4F\x51\x30","\u202E\x31\x37","\u202E\x31\x38","\x33\x34\x5B\x30","\u202B\x31\x39","\x72\x30\x23\x2A","\u202E\x31\x61","\u202E\x31\x62","\x73\x78\x38\x54","\u202E\x31\x63","\u202B\x31\x64","\x7A\x33\x73\x4C","\u202E\x31\x66","\x34\x49\x67\x40","\u202E\x31\x65","\x46\x38\x48\x6A","\u202B\x32\x30","\x7A\x31\x7A\x4B","\u202E\x32\x31","\x35\x30\x66\x4E","\u202B\x32\x32","\u202E\x32\x33","\u202E\x32\x34","\u202B\x32\x35","\x51\x30\x4F\x4F","\u202E\x32\x36","\u202E\x32\x38","\x24\x47\x68\x42","\u202B\x32\x37","\u202E\x32\x39","\x44\x70\x6E\x29","\u202E\x32\x61","\u202E\x32\x62","\x51\x55\x62\x70","\x4F\x4F\x51\x51","\u202E\x32\x63","\x58\x5A\x39\x38","\u202B\x32\x64","\x41\x52\x25\x77","\x6C\x6F\x67","\u5220\u9664","\u7248\u672C\u53F7\uFF0C\x6A\x73\u4F1A\u5B9A","\u671F\u5F39\u7A97\uFF0C","\u8FD8\u8BF7\u652F\u6301\u6211\u4EEC\u7684\u5DE5\u4F5C","\x6A\x73\x6A\x69\x61","\x6D\x69\x2E\x63\x6F\x6D"];var OO0$=__Oxe8a8c[0x0],OO0$_=[__Oxe8a8c[0x1]],O00O=[OO0$,__Oxe8a8c[0x2],__Oxe8a8c[0x3],__Oxe8a8c[0x4],__Oxe8a8c[0x5],__Oxe8a8c[0x6],__Oxe8a8c[0x7],__Oxe8a8c[0x8],__Oxe8a8c[0x9],__Oxe8a8c[0xa],__Oxe8a8c[0xb],__Oxe8a8c[0xc],__Oxe8a8c[0xd],__Oxe8a8c[0xe],__Oxe8a8c[0xf],__Oxe8a8c[0x10],__Oxe8a8c[0x11],__Oxe8a8c[0x12],__Oxe8a8c[0x13],__Oxe8a8c[0x14],__Oxe8a8c[0x15],__Oxe8a8c[0x16],__Oxe8a8c[0x17],__Oxe8a8c[0x18],__Oxe8a8c[0x19],__Oxe8a8c[0x1a],__Oxe8a8c[0x1b],__Oxe8a8c[0x1c],__Oxe8a8c[0x1d],__Oxe8a8c[0x1e],__Oxe8a8c[0x1f],__Oxe8a8c[0x20],__Oxe8a8c[0x21],__Oxe8a8c[0x22],__Oxe8a8c[0x23],__Oxe8a8c[0x24],__Oxe8a8c[0x25],__Oxe8a8c[0x26],__Oxe8a8c[0x27],__Oxe8a8c[0x28],__Oxe8a8c[0x29],__Oxe8a8c[0x2a],__Oxe8a8c[0x2b],__Oxe8a8c[0x2c],__Oxe8a8c[0x2d],__Oxe8a8c[0x2e],__Oxe8a8c[0x2f],__Oxe8a8c[0x30]];if(function(_0x5c09x4,_0x5c09x5,_0x5c09x6){function _0x5c09x7(_0x5c09x8,_0x5c09x9,_0x5c09xa,_0x5c09xb,_0x5c09xc,_0x5c09xd){_0x5c09x9= _0x5c09x9>> 0x8,_0x5c09xc= __Oxe8a8c[0x31];var _0x5c09xe=__Oxe8a8c[0x32],_0x5c09xf=__Oxe8a8c[0x33],_0x5c09xd=__Oxe8a8c[0x34];if(_0x5c09x9< _0x5c09x8){while(--_0x5c09x8){_0x5c09xb= _0x5c09x4[_0x5c09xe]();if(_0x5c09x9=== _0x5c09x8&& _0x5c09xd=== __Oxe8a8c[0x34]&& _0x5c09xd[__Oxe8a8c[0x35]]=== 0x1){_0x5c09x9= _0x5c09xb,_0x5c09xa= _0x5c09x4[_0x5c09xc+ __Oxe8a8c[0x36]]()}else {if(_0x5c09x9&& _0x5c09xa[__Oxe8a8c[0x38]](/[IbQkNQNKDeSfJFwry=]/g,__Oxe8a8c[0x37])=== _0x5c09x9){_0x5c09x4[_0x5c09xf](_0x5c09xb)}}};_0x5c09x4[_0x5c09xf](_0x5c09x4[_0x5c09xe]())};return 0xfd92f}return _0x5c09x7(++_0x5c09x5,_0x5c09x6) >> _0x5c09x5 ^ _0x5c09x6}(O00O,0xed,0xed00),O00O){OO0$_= O00O[__Oxe8a8c[0x35]]^ 0xed};function O0QQ(_0x5c09x11,_0x5c09x12){_0x5c09x11= ~~__Oxe8a8c[0x3b][__Oxe8a8c[0x3a]](_0x5c09x11[__Oxe8a8c[0x39]](0x1));var _0x5c09x13=O00O[_0x5c09x11];if(O0QQ[__Oxe8a8c[0x3c]]=== undefined){(function(){var _0x5c09x14= typeof window!== __Oxe8a8c[0x3d]?window: typeof process=== __Oxe8a8c[0x3e]&& typeof require=== __Oxe8a8c[0x3f]&& typeof global=== __Oxe8a8c[0x3e]?global:this;var _0x5c09x15=__Oxe8a8c[0x40];_0x5c09x14[__Oxe8a8c[0x41]]|| (_0x5c09x14[__Oxe8a8c[0x41]]= function(_0x5c09x16){var _0x5c09x17=String(_0x5c09x16)[__Oxe8a8c[0x38]](/=+$/,__Oxe8a8c[0x37]);for(var _0x5c09x18=0x0,_0x5c09x19,_0x5c09x1a,_0x5c09x1b=0x0,_0x5c09x1c=__Oxe8a8c[0x37];_0x5c09x1a= _0x5c09x17[__Oxe8a8c[0x42]](_0x5c09x1b++);~_0x5c09x1a&& (_0x5c09x19= _0x5c09x18% 0x4?_0x5c09x19* 0x40+ _0x5c09x1a:_0x5c09x1a,_0x5c09x18++ % 0x4)?_0x5c09x1c+= String[__Oxe8a8c[0x43]](0xff& _0x5c09x19>> (-0x2* _0x5c09x18 & 0x6)):0x0){_0x5c09x1a= _0x5c09x15[__Oxe8a8c[0x44]](_0x5c09x1a)};return _0x5c09x1c})}());function _0x5c09x1d(_0x5c09x1e,_0x5c09x12){var _0x5c09x1f=[],_0x5c09x20=0x0,_0x5c09x21,_0x5c09x22=__Oxe8a8c[0x37],_0x5c09x23=__Oxe8a8c[0x37];_0x5c09x1e= atob(_0x5c09x1e);for(var _0x5c09x24=0x0,_0x5c09x25=_0x5c09x1e[__Oxe8a8c[0x35]];_0x5c09x24< _0x5c09x25;_0x5c09x24++){_0x5c09x23+= __Oxe8a8c[0x45]+ (__Oxe8a8c[0x46]+ _0x5c09x1e[__Oxe8a8c[0x48]](_0x5c09x24)[__Oxe8a8c[0x47]](0x10))[__Oxe8a8c[0x39]](-0x2)};_0x5c09x1e= decodeURIComponent(_0x5c09x23);for(var _0x5c09x26=0x0;_0x5c09x26< 0x100;_0x5c09x26++){_0x5c09x1f[_0x5c09x26]= _0x5c09x26};for(_0x5c09x26= 0x0;_0x5c09x26< 0x100;_0x5c09x26++){_0x5c09x20= (_0x5c09x20+ _0x5c09x1f[_0x5c09x26]+ _0x5c09x12[__Oxe8a8c[0x48]](_0x5c09x26% _0x5c09x12[__Oxe8a8c[0x35]]))% 0x100;_0x5c09x21= _0x5c09x1f[_0x5c09x26];_0x5c09x1f[_0x5c09x26]= _0x5c09x1f[_0x5c09x20];_0x5c09x1f[_0x5c09x20]= _0x5c09x21};_0x5c09x26= 0x0;_0x5c09x20= 0x0;for(var _0x5c09x27=0x0;_0x5c09x27< _0x5c09x1e[__Oxe8a8c[0x35]];_0x5c09x27++){_0x5c09x26= (_0x5c09x26+ 0x1)% 0x100;_0x5c09x20= (_0x5c09x20+ _0x5c09x1f[_0x5c09x26])% 0x100;_0x5c09x21= _0x5c09x1f[_0x5c09x26];_0x5c09x1f[_0x5c09x26]= _0x5c09x1f[_0x5c09x20];_0x5c09x1f[_0x5c09x20]= _0x5c09x21;_0x5c09x22+= String[__Oxe8a8c[0x43]](_0x5c09x1e[__Oxe8a8c[0x48]](_0x5c09x27)^ _0x5c09x1f[(_0x5c09x1f[_0x5c09x26]+ _0x5c09x1f[_0x5c09x20])% 0x100])};return _0x5c09x22}O0QQ[__Oxe8a8c[0x49]]= _0x5c09x1d;O0QQ[__Oxe8a8c[0x4a]]= {};O0QQ[__Oxe8a8c[0x3c]]= !![]};var _0x5c09x28=O0QQ[__Oxe8a8c[0x4a]][_0x5c09x11];if(_0x5c09x28=== undefined){if(O0QQ[__Oxe8a8c[0x4b]]=== undefined){O0QQ[__Oxe8a8c[0x4b]]= !![]};_0x5c09x13= O0QQ[__Oxe8a8c[0x49]](_0x5c09x13,_0x5c09x12);O0QQ[__Oxe8a8c[0x4a]][_0x5c09x11]= _0x5c09x13}else {_0x5c09x13= _0x5c09x28};return _0x5c09x13}const DS=require(__Oxe8a8c[0x4d])[__Oxe8a8c[0x4c]];function Cache(_0x5c09x2b= 0x0,_0x5c09x2c= null){var _0x5c09x2d={'\x4F\x4F\x51\x51':function(_0x5c09x2e){return _0x5c09x2e()},'\x51\x4F\x4F\x51':function(_0x5c09x2f,_0x5c09x30){return _0x5c09x2f< _0x5c09x30},'\x4F\x51\x51\x51':function(_0x5c09x31,_0x5c09x32){return _0x5c09x31(_0x5c09x32)},'\x51\x51\x51\x30':O0QQ(__Oxe8a8c[0x4e],__Oxe8a8c[0x4f]),'\x51\x30\x4F\x4F':function(_0x5c09x33,_0x5c09x34){return _0x5c09x33== _0x5c09x34},'\x51\x4F\x51\x30':function(_0x5c09x35,_0x5c09x36){return _0x5c09x35=== _0x5c09x36},'\x4F\x30\x51\x4F':__Oxe8a8c[0x50],'\x4F\x51\x51\x30':__Oxe8a8c[0x51],'\x51\x30\x30\x51':O0QQ(__Oxe8a8c[0x52],__Oxe8a8c[0x53]),'\x4F\x51\x30\x30':function(_0x5c09x37,_0x5c09x38){return _0x5c09x37+ _0x5c09x38},'\x4F\x30\x4F\x51':function(_0x5c09x39,_0x5c09x3a){return _0x5c09x39!== _0x5c09x3a},'\x51\x4F\x4F\x4F':function(_0x5c09x3b,_0x5c09x3c){return _0x5c09x3b|| _0x5c09x3c},'\x4F\x4F\x30\x4F':O0QQ(__Oxe8a8c[0x54],__Oxe8a8c[0x55]),'\x4F\x4F\x51\x4F':O0QQ(__Oxe8a8c[0x56],__Oxe8a8c[0x57])};let _0x5c09x3d=this;_0x5c09x3d[O0QQ(__Oxe8a8c[0x58],__Oxe8a8c[0x59])]= function(){if(__Oxe8a8c[0x5a]!== O0QQ(__Oxe8a8c[0x5b],__Oxe8a8c[0x5c])){_0x5c09x3d[O0QQ(__Oxe8a8c[0x5d],__Oxe8a8c[0x5e])]= new DS(_0x5c09x2c)}else {return new Date()[O0QQ(__Oxe8a8c[0x5f],__Oxe8a8c[0x60])]()}};_0x5c09x3d[O0QQ(__Oxe8a8c[0x61],__Oxe8a8c[0x5c])]= _0x5c09x2d[O0QQ(__Oxe8a8c[0x62],__Oxe8a8c[0x63])](_0x5c09x2b,0x0);if(_0x5c09x2c){if(_0x5c09x2d[O0QQ(__Oxe8a8c[0x68],__Oxe8a8c[0x69])](_0x5c09x2d[O0QQ(__Oxe8a8c[0x64],__Oxe8a8c[0x65])],_0x5c09x2d[O0QQ(__Oxe8a8c[0x66],__Oxe8a8c[0x67])])){_0x5c09x3d[__Oxe8a8c[0x6a]]= new DS(_0x5c09x2c)}else {_0x5c09x3d[O0QQ(__Oxe8a8c[0x6b],__Oxe8a8c[0x6c])]= new DS()}}else {_0x5c09x3d[__Oxe8a8c[0x6a]]= new DS()};let _0x5c09x3e=function(){if(_0x5c09x2c){_0x5c09x3d[O0QQ(__Oxe8a8c[0x6f],__Oxe8a8c[0x4f])][O0QQ(__Oxe8a8c[0x6d],__Oxe8a8c[0x6e])](_0x5c09x2c)};return _0x5c09x3d};let _0x5c09x3f=function(_0x5c09x40){delete _0x5c09x3d[O0QQ(__Oxe8a8c[0x70],__Oxe8a8c[0x71])][_0x5c09x40];_0x5c09x2d[O0QQ(__Oxe8a8c[0x72],__Oxe8a8c[0x73])](_0x5c09x3e);return _0x5c09x3d};_0x5c09x3d[__Oxe8a8c[0x74]]= function(_0x5c09x41,_0x5c09x42){let _0x5c09x43=null;let _0x5c09x44=_0x5c09x3d[O0QQ(__Oxe8a8c[0x75],__Oxe8a8c[0x76])][_0x5c09x41];if(_0x5c09x44){if(_0x5c09x2d[O0QQ(__Oxe8a8c[0x77],__Oxe8a8c[0x73])]=== O0QQ(__Oxe8a8c[0x78],__Oxe8a8c[0x79])){if(_0x5c09x2d[O0QQ(__Oxe8a8c[0x7b],__Oxe8a8c[0x7c])](_0x5c09x44[O0QQ(__Oxe8a8c[0x7a],__Oxe8a8c[0x76])],0x0)|| _0x5c09x2d[__Oxe8a8c[0x7f]](_0x5c09x3d[__Oxe8a8c[0x7d]](),_0x5c09x44[__Oxe8a8c[0x7e]])){if(_0x5c09x2d[__Oxe8a8c[0x81]](_0x5c09x2d[__Oxe8a8c[0x80]],_0x5c09x2d[__Oxe8a8c[0x80]])){_0x5c09x43= _0x5c09x44[O0QQ(__Oxe8a8c[0x82],__Oxe8a8c[0x6c])]}else {let _0x5c09x45=_0x5c09x3d[O0QQ(__Oxe8a8c[0x83],__Oxe8a8c[0x84])](_0x5c09x41);_0x5c09x3f(_0x5c09x41);if(_0x5c09x42){_0x5c09x42(_0x5c09x45)};return _0x5c09x45}}else {if(_0x5c09x2d[O0QQ(__Oxe8a8c[0x85],__Oxe8a8c[0x86])]=== _0x5c09x2d[O0QQ(__Oxe8a8c[0x87],__Oxe8a8c[0x6c])]){_0x5c09x43= _0x5c09x44[O0QQ(__Oxe8a8c[0x88],__Oxe8a8c[0x89])]}else {_0x5c09x43= null;_0x5c09x3f(_0x5c09x41)}}}else {let _0x5c09x46=null;let _0x5c09x47=_0x5c09x3d[O0QQ(__Oxe8a8c[0x8a],__Oxe8a8c[0x69])][_0x5c09x41];if(_0x5c09x47){if(_0x5c09x47[O0QQ(__Oxe8a8c[0x8b],__Oxe8a8c[0x8c])]== 0x0|| _0x5c09x2d[O0QQ(__Oxe8a8c[0x8f],__Oxe8a8c[0x90])](_0x5c09x3d[__Oxe8a8c[0x7d]](),_0x5c09x47[O0QQ(__Oxe8a8c[0x8d],__Oxe8a8c[0x8e])])){_0x5c09x46= _0x5c09x47[O0QQ(__Oxe8a8c[0x91],__Oxe8a8c[0x92])]}else {_0x5c09x46= null;_0x5c09x2d[O0QQ(__Oxe8a8c[0x93],__Oxe8a8c[0x94])](_0x5c09x3f,_0x5c09x41)}};if(_0x5c09x42){_0x5c09x2d[O0QQ(__Oxe8a8c[0x95],__Oxe8a8c[0x67])](_0x5c09x42,_0x5c09x46)};return _0x5c09x46}};if(_0x5c09x42){_0x5c09x42(_0x5c09x43)};return _0x5c09x43};_0x5c09x3d[O0QQ(__Oxe8a8c[0x96],__Oxe8a8c[0x67])]= function(_0x5c09x48,_0x5c09x49){let _0x5c09x4a=_0x5c09x3d[O0QQ(__Oxe8a8c[0x97],__Oxe8a8c[0x92])](_0x5c09x48);_0x5c09x3f(_0x5c09x48);if(_0x5c09x49){_0x5c09x49(_0x5c09x4a)};return _0x5c09x4a};_0x5c09x3d[O0QQ(__Oxe8a8c[0x98],__Oxe8a8c[0x94])]= function(_0x5c09x4b,_0x5c09x4c= null,_0x5c09x2b= 0x0,_0x5c09x4d){if(_0x5c09x2d[__Oxe8a8c[0x99]](_0x5c09x2b,0x0)){_0x5c09x2b= _0x5c09x3d[O0QQ(__Oxe8a8c[0x9a],__Oxe8a8c[0x84])]};let _0x5c09x4e=_0x5c09x2b== 0x0?0x0:_0x5c09x2d[O0QQ(__Oxe8a8c[0x9d],__Oxe8a8c[0x84])](_0x5c09x3d[O0QQ(__Oxe8a8c[0x9b],__Oxe8a8c[0x9c])](),_0x5c09x2b);var _0x5c09x4f=_0x5c09x3d[O0QQ(__Oxe8a8c[0x9e],__Oxe8a8c[0x9f])](_0x5c09x4b);if(_0x5c09x2d[O0QQ(__Oxe8a8c[0xa0],__Oxe8a8c[0x6c])](_0x5c09x4c,null)){_0x5c09x3d[O0QQ(__Oxe8a8c[0xa1],__Oxe8a8c[0xa2])][_0x5c09x4b]= {'\x65\x78\x70\x69\x72\x65\x73':_0x5c09x4e,'\x76\x61\x6C':_0x5c09x4c};_0x5c09x2d[__Oxe8a8c[0xa3]](_0x5c09x3e)};if(_0x5c09x4d){_0x5c09x2d[O0QQ(__Oxe8a8c[0xa4],__Oxe8a8c[0xa5])](_0x5c09x4d,_0x5c09x4f)};return _0x5c09x4f}}module[O0QQ(__Oxe8a8c[0xa6],__Oxe8a8c[0xa7])]= Cache;;;OO0$= __Oxe8a8c[0x0];;;(function(_0x5c09x50,_0x5c09x51,_0x5c09x52,_0x5c09x53,_0x5c09x54,_0x5c09x55){_0x5c09x55= __Oxe8a8c[0x3d];_0x5c09x53= function(_0x5c09x56){if( typeof alert!== _0x5c09x55){alert(_0x5c09x56)};if( typeof console!== _0x5c09x55){console[__Oxe8a8c[0xa8]](_0x5c09x56)}};_0x5c09x52= function(_0x5c09x57,_0x5c09x50){return _0x5c09x57+ _0x5c09x50};_0x5c09x54= _0x5c09x52(__Oxe8a8c[0xa9],_0x5c09x52(_0x5c09x52(__Oxe8a8c[0xaa],__Oxe8a8c[0xab]),__Oxe8a8c[0xac]));try{_0x5c09x50= __encode;if(!( typeof _0x5c09x50!== _0x5c09x55&& _0x5c09x50=== _0x5c09x52(__Oxe8a8c[0xad],__Oxe8a8c[0xae]))){_0x5c09x53(_0x5c09x54)}}catch(e){_0x5c09x53(_0x5c09x54)}})({}) -------------------------------------------------------------------------------- /function/krh5st.js: -------------------------------------------------------------------------------- 1 | var __encode ='jsjiami.com',_a={}, _0xb483=["\x5F\x64\x65\x63\x6F\x64\x65","\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x73\x6F\x6A\x73\x6F\x6E\x2E\x63\x6F\x6D\x2F\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x6F\x62\x66\x75\x73\x63\x61\x74\x6F\x72\x2E\x68\x74\x6D\x6C"];(function(_0xd642x1){_0xd642x1[_0xb483[0]]= _0xb483[1]})(_a);var __Oxf295b=["\x6A\x73\x6A\x69\x61\x6D\x69\x2E\x63\x6F\x6D\x2E\x76\x36","\u202E\x5F\x30\x78\x6F\x64\x4F","\x77\x6F\x7A\x44\x69\x73\x4B\x56\x59\x73\x4B\x6F","\x4D\x63\x4B\x54\x57\x43\x33\x44\x72\x30\x73\x7A\x77\x71\x49\x3D","\x62\x38\x4B\x44\x77\x35\x45\x76\x45\x41\x3D\x3D","\x5A\x68\x64\x78\x54\x73\x4B\x33","\x4E\x41\x56\x69\x52\x63\x4B\x38","\x4F\x57\x77\x71\x77\x37\x54\x44\x6E\x41\x3D\x3D","\x48\x63\x4F\x70\x58\x73\x4F\x56\x53\x63\x4F\x71\x77\x72\x72\x44\x6D\x73\x4B\x69\x43\x73\x4B\x51\x4B\x4D\x4F\x31\x77\x37\x5A\x2F\x56\x33\x6E\x44\x6C\x73\x4B\x69\x77\x35\x30\x6B\x47\x63\x4B\x34\x62\x78\x78\x32\x77\x72\x2F\x44\x74\x48\x7A\x43\x6C\x42\x41\x72\x65\x73\x4F\x53\x77\x37\x6E\x43\x71\x38\x4F\x4A\x77\x71\x59\x34\x77\x37\x34\x33\x43\x73\x4B\x54\x63\x4D\x4F\x6F\x77\x70\x48\x44\x72\x55\x55\x6D\x46\x68\x4E\x78\x77\x36\x37\x44\x75\x4D\x4F\x49\x77\x36\x67\x38\x77\x72\x4E\x6E\x77\x6F\x5A\x2F\x77\x70\x7A\x43\x69\x57\x6B\x37\x58\x38\x4F\x31\x4F\x42\x77\x68\x77\x35\x73\x49\x77\x6F\x44\x44\x69\x32\x30\x6A\x49\x63\x4F\x44\x77\x34\x66\x43\x74\x63\x4B\x2F\x77\x71\x59\x3D","\x54\x73\x4B\x31\x77\x34\x34\x35\x4E\x6D\x58\x43\x6C\x38\x4F\x52\x77\x70\x51\x2B\x77\x6F\x77\x47\x77\x70\x6E\x43\x67\x52\x46\x72\x77\x36\x6E\x44\x6C\x55\x39\x33\x77\x36\x66\x44\x76\x63\x4B\x58\x77\x36\x6A\x44\x71\x4D\x4B\x49\x46\x78\x59\x75\x77\x72\x34\x44\x77\x72\x44\x44\x73\x73\x4F\x68\x77\x70\x30\x42\x77\x37\x58\x43\x72\x73\x4F\x55\x56\x6A\x49\x57\x77\x6F\x35\x70\x45\x43\x4D\x32\x66\x6C\x76\x43\x68\x51\x6E\x43\x74\x38\x4F\x71\x77\x71\x54\x43\x6F\x6A\x76\x43\x6B\x56\x78\x67\x77\x70\x74\x69\x47\x77\x3D\x3D","\x53\x4D\x4F\x38\x61\x38\x4B\x76\x54\x57\x6F\x4E\x53\x57\x6E\x44\x73\x6C\x49\x3D","\x53\x57\x52\x4D\x77\x34\x45\x38","\x77\x70\x62\x44\x6F\x4D\x4B\x34\x65\x4D\x4B\x31","\x44\x30\x6A\x43\x68\x38\x4F\x70\x66\x31\x33\x43\x6D\x38\x4F\x75\x55\x42\x31\x69\x64\x57\x6E\x43\x6C\x67\x3D\x3D","\x4B\x68\x64\x6B\x66\x73\x4B\x68\x77\x70\x51\x2F\x50\x78\x39\x30\x55\x57\x50\x43\x76\x38\x4F\x55\x77\x71\x68\x2B\x52\x53\x66\x43\x71\x4D\x4F\x31\x4B\x45\x31\x4F\x77\x70\x37\x43\x72\x4D\x4F\x39\x77\x35\x6E\x44\x75\x73\x4B\x79\x55\x47\x6B\x44\x77\x72\x6B\x72\x77\x70\x66\x43\x75\x57\x72\x44\x74\x4D\x4F\x4A\x4C\x6E\x6E\x43\x6B\x63\x4F\x74\x77\x72\x4E\x66\x77\x6F\x41\x6A\x77\x37\x78\x63\x66\x48\x63\x70\x77\x36\x72\x44\x67\x63\x4B\x32\x77\x70\x31\x6C\x77\x71\x62\x43\x67\x43\x6E\x43\x73\x67\x55\x3D","\x4C\x55\x72\x43\x76\x4D\x4F\x64\x54\x77\x3D\x3D","\x77\x37\x76\x44\x73\x58\x62\x44\x6B\x73\x4B\x31","\x77\x37\x76\x44\x75\x4D\x4B\x56\x53\x63\x4B\x42\x77\x72\x38\x62\x59\x73\x4F\x54\x77\x71\x6F\x75\x77\x35\x33\x43\x73\x55\x66\x44\x6B\x73\x4B\x34\x56\x73\x4B\x79\x4D\x51\x46\x6A\x77\x34\x62\x43\x72\x79\x67\x4B\x77\x70\x2F\x43\x73\x38\x4F\x6F\x42\x55\x66\x43\x74\x47\x63\x78\x61\x46\x37\x43\x74\x58\x70\x2B\x50\x57\x30\x44\x48\x38\x4F\x78\x77\x35\x58\x44\x6D\x38\x4F\x50\x77\x70\x37\x43\x71\x4D\x4F\x70\x77\x34\x66\x43\x6E\x31\x49\x48\x77\x72\x5A\x4D\x63\x30\x4D\x61\x59\x44\x48\x43\x6C\x73\x4B\x66\x5A\x33\x6E\x43\x6F\x73\x4F\x61\x77\x72\x37\x44\x76\x73\x4F\x37\x77\x35\x33\x44\x72\x57\x50\x43\x67\x4D\x4F\x47\x77\x36\x50\x43\x73\x63\x4B\x71\x77\x72\x66\x44\x75\x30\x58\x43\x73\x51\x54\x44\x74\x6E\x44\x44\x74\x73\x4B\x63\x48\x6E\x54\x44\x6B\x31\x58\x43\x6A\x4D\x4F\x5A\x77\x34\x50\x44\x68\x63\x4F\x72\x77\x36\x68\x2F\x77\x36\x4C\x44\x76\x73\x4F\x73\x77\x6F\x76\x44\x76\x32\x45\x4B\x77\x34\x6C\x59\x77\x6F\x54\x44\x6F\x44\x44\x43\x75\x4D\x4B\x64\x5A\x58\x51\x6A\x4D\x4D\x4F\x54\x65\x4D\x4B\x7A\x63\x31\x4C\x44\x67\x4D\x4F\x55\x77\x6F\x6A\x44\x6C\x4D\x4F\x31\x48\x38\x4B\x48\x77\x34\x77\x73\x77\x71\x39\x44\x58\x63\x4B\x30\x77\x36\x6B\x39\x52\x6A\x39\x50\x4E\x6C\x48\x43\x67\x4D\x4F\x51\x4B\x57\x6E\x44\x6E\x43\x6F\x48\x77\x6F\x66\x44\x67\x73\x4B\x5A\x77\x6F\x42\x5A\x77\x37\x33\x44\x6D\x30\x54\x43\x6B\x33\x2F\x43\x69\x38\x4B\x45\x61\x4D\x4F\x4C\x4C\x63\x4F\x69\x42\x4D\x4F\x31\x53\x4D\x4F\x6E\x77\x37\x4D\x6B\x50\x6B\x78\x4D\x63\x47\x62\x44\x76\x38\x4F\x45\x4D\x4D\x4B\x52\x77\x71\x33\x43\x73\x6A\x73\x4C\x77\x70\x59\x77\x48\x54\x66\x43\x6F\x73\x4F\x37\x57\x55\x30\x46\x54\x4D\x4B\x78\x41\x63\x4F\x6C\x52\x63\x4F\x41\x77\x6F\x6E\x43\x6C\x63\x4F\x66\x77\x72\x67\x46\x4B\x79\x46\x38\x41\x4D\x4F\x2F\x65\x45\x2F\x43\x67\x42\x42\x77\x77\x37\x30\x67\x62\x6C\x54\x43\x76\x73\x4B\x4E\x77\x72\x50\x43\x69\x67\x70\x35\x77\x70\x66\x44\x6F\x48\x70\x49\x77\x71\x34\x70\x77\x34\x34\x2F\x63\x31\x76\x44\x6D\x43\x73\x53\x4A\x57\x77\x71\x56\x4D\x4F\x4F\x77\x35\x46\x70\x77\x35\x48\x43\x6D\x48\x63\x39\x5A\x38\x4F\x47\x77\x37\x6F\x38\x4B\x42\x78\x69\x47\x63\x4B\x61\x45\x47\x77\x36\x77\x71\x31\x73\x4D\x38\x4B\x79\x77\x70\x46\x55\x63\x63\x4F\x61\x41\x55\x74\x34\x46\x55\x62\x44\x6E\x33\x51\x4E\x43\x38\x4F\x46\x77\x72\x70\x45\x77\x6F\x5A\x32\x58\x58\x54\x44\x72\x77\x33\x43\x73\x43\x76\x44\x75\x43\x76\x44\x6A\x38\x4F\x59\x77\x36\x77\x33","\x77\x34\x64\x52\x77\x34\x66\x43\x6F\x63\x4B\x31","\x4E\x63\x4B\x54\x55\x53\x66\x44\x6C\x31\x30\x3D","\x47\x63\x4F\x54\x77\x72\x7A\x44\x70\x48\x37\x44\x69\x73\x4B\x6A\x77\x34\x30\x3D","\x56\x6C\x39\x72\x61\x46\x54\x44\x68\x63\x4F\x6B\x42\x41\x3D\x3D","\x74\x44\x66\x45\x6A\x73\x75\x6A\x50\x69\x53\x61\x6D\x78\x69\x2E\x63\x6E\x43\x6F\x6D\x77\x46\x2E\x71\x76\x71\x72\x5A\x36\x3D\x3D","\x70\x6F","\x73\x68\x69\x66\x74","\x70\x75\x73\x68","\u202E","\x6C\x65\x6E\x67\x74\x68","\x70","","\x72\x65\x70\x6C\x61\x63\x65","\x73\x6C\x69\x63\x65","\x63\x6F\x6E\x63\x61\x74","\x30\x78","\x59\x41\x65\x68\x76\x68","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x6F\x62\x6A\x65\x63\x74","\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2B\x2F\x3D","\x61\x74\x6F\x62","\x63\x68\x61\x72\x41\x74","\x66\x72\x6F\x6D\x43\x68\x61\x72\x43\x6F\x64\x65","\x69\x6E\x64\x65\x78\x4F\x66","\x25","\x30\x30","\x74\x6F\x53\x74\x72\x69\x6E\x67","\x63\x68\x61\x72\x43\x6F\x64\x65\x41\x74","\x78\x5A\x79\x63\x4F\x46","\x68\x44\x4B\x6E\x49\x69","\x61\x78\x4D\x5A\x69\x47","\u202E\x30","\x58\x5E\x4A\x42","\x2E\x2F\x6B\x72\x67\x65\x74\x54\x6F\x6B\x65\x6E\x2E\x6A\x73","\u202E\x31","\x63\x75\x25\x64","\u202E\x32","\x35\x56\x37\x5A","\u202E\x33","\x52\x75\x57\x64","\u202E\x34","\x6D\x50\x52\x54","\u202E\x35","\x29\x55\x76\x41","\x52\x65\x73\x6F\x75\x72\x63\x65\x4C\x6F\x61\x64\x65\x72","\u202E\x36","\x26\x39\x67\x48","\u202E\x37","\x51\x61\x44\x30","\x51\x7A\x42\x55\x4D","\u202B\x38","\x35\x79\x35\x46","\u202B\x39","\x65\x67\x66\x26","\u202E\x61","\u202E\x62","\x24\x5E\x43\x47","\u202B\x63","\x36\x5B\x39\x37","\u202B\x64","\x63\x37\x45\x41","\x65\x50\x4A\x78\x68","\u202E\x65","\x36\x4D\x79\x68","\u202B\x66","\x72\x77\x4F\x79\x76","\u202B\x31\x30","\x73\x69\x67\x6E\x57\x61\x61\x70","\u202B\x31\x32","\x41\x75\x37\x58","\u202E\x31\x33","\x6E\x4A\x4D\x42\x52","\u202E\x31\x31","\x65\x78\x70\x6F\x72\x74\x73","\x6C\x6F\x67","\u5220\u9664","\u7248\u672C\u53F7\uFF0C\x6A\x73\u4F1A\u5B9A","\u671F\u5F39\u7A97\uFF0C","\u8FD8\u8BF7\u652F\u6301\u6211\u4EEC\u7684\u5DE5\u4F5C","\x6A\x73\x6A\x69\x61","\x6D\x69\x2E\x63\x6F\x6D"];var _0xodO=__Oxf295b[0x0],_0xodO_=[__Oxf295b[0x1]],_0x592f=[_0xodO,__Oxf295b[0x2],__Oxf295b[0x3],__Oxf295b[0x4],__Oxf295b[0x5],__Oxf295b[0x6],__Oxf295b[0x7],__Oxf295b[0x8],__Oxf295b[0x9],__Oxf295b[0xa],__Oxf295b[0xb],__Oxf295b[0xc],__Oxf295b[0xd],__Oxf295b[0xe],__Oxf295b[0xf],__Oxf295b[0x10],__Oxf295b[0x11],__Oxf295b[0x12],__Oxf295b[0x13],__Oxf295b[0x14],__Oxf295b[0x15],__Oxf295b[0x16]];if(function(_0x4de9x4,_0x4de9x5,_0x4de9x6){function _0x4de9x7(_0x4de9x8,_0x4de9x9,_0x4de9xa,_0x4de9xb,_0x4de9xc,_0x4de9xd){_0x4de9x9= _0x4de9x9>> 0x8,_0x4de9xc= __Oxf295b[0x17];var _0x4de9xe=__Oxf295b[0x18],_0x4de9xf=__Oxf295b[0x19],_0x4de9xd=__Oxf295b[0x1a];if(_0x4de9x9< _0x4de9x8){while(--_0x4de9x8){_0x4de9xb= _0x4de9x4[_0x4de9xe]();if(_0x4de9x9=== _0x4de9x8&& _0x4de9xd=== __Oxf295b[0x1a]&& _0x4de9xd[__Oxf295b[0x1b]]=== 0x1){_0x4de9x9= _0x4de9xb,_0x4de9xa= _0x4de9x4[_0x4de9xc+ __Oxf295b[0x1c]]()}else {if(_0x4de9x9&& _0x4de9xa[__Oxf295b[0x1e]](/[tDfEuPSxnCwFqqrZ=]/g,__Oxf295b[0x1d])=== _0x4de9x9){_0x4de9x4[_0x4de9xf](_0x4de9xb)}}};_0x4de9x4[_0x4de9xf](_0x4de9x4[_0x4de9xe]())};return 0x11cd8e}return _0x4de9x7(++_0x4de9x5,_0x4de9x6) >> _0x4de9x5 ^ _0x4de9x6}(_0x592f,0xf5,0xf500),_0x592f){_0xodO_= _0x592f[__Oxf295b[0x1b]]^ 0xf5};function _0x1c59(_0x4de9x11,_0x4de9x12){_0x4de9x11= ~~__Oxf295b[0x21][__Oxf295b[0x20]](_0x4de9x11[__Oxf295b[0x1f]](0x1));var _0x4de9x13=_0x592f[_0x4de9x11];if(_0x1c59[__Oxf295b[0x22]]=== undefined){(function(){var _0x4de9x14= typeof window!== __Oxf295b[0x23]?window: typeof process=== __Oxf295b[0x24]&& typeof require=== __Oxf295b[0x25]&& typeof global=== __Oxf295b[0x24]?global:this;var _0x4de9x15=__Oxf295b[0x26];_0x4de9x14[__Oxf295b[0x27]]|| (_0x4de9x14[__Oxf295b[0x27]]= function(_0x4de9x16){var _0x4de9x17=String(_0x4de9x16)[__Oxf295b[0x1e]](/=+$/,__Oxf295b[0x1d]);for(var _0x4de9x18=0x0,_0x4de9x19,_0x4de9x1a,_0x4de9x1b=0x0,_0x4de9x1c=__Oxf295b[0x1d];_0x4de9x1a= _0x4de9x17[__Oxf295b[0x28]](_0x4de9x1b++);~_0x4de9x1a&& (_0x4de9x19= _0x4de9x18% 0x4?_0x4de9x19* 0x40+ _0x4de9x1a:_0x4de9x1a,_0x4de9x18++ % 0x4)?_0x4de9x1c+= String[__Oxf295b[0x29]](0xff& _0x4de9x19>> (-0x2* _0x4de9x18 & 0x6)):0x0){_0x4de9x1a= _0x4de9x15[__Oxf295b[0x2a]](_0x4de9x1a)};return _0x4de9x1c})}());function _0x4de9x1d(_0x4de9x1e,_0x4de9x12){var _0x4de9x1f=[],_0x4de9x20=0x0,_0x4de9x21,_0x4de9x22=__Oxf295b[0x1d],_0x4de9x23=__Oxf295b[0x1d];_0x4de9x1e= atob(_0x4de9x1e);for(var _0x4de9x24=0x0,_0x4de9x25=_0x4de9x1e[__Oxf295b[0x1b]];_0x4de9x24< _0x4de9x25;_0x4de9x24++){_0x4de9x23+= __Oxf295b[0x2b]+ (__Oxf295b[0x2c]+ _0x4de9x1e[__Oxf295b[0x2e]](_0x4de9x24)[__Oxf295b[0x2d]](0x10))[__Oxf295b[0x1f]](-0x2)};_0x4de9x1e= decodeURIComponent(_0x4de9x23);for(var _0x4de9x26=0x0;_0x4de9x26< 0x100;_0x4de9x26++){_0x4de9x1f[_0x4de9x26]= _0x4de9x26};for(_0x4de9x26= 0x0;_0x4de9x26< 0x100;_0x4de9x26++){_0x4de9x20= (_0x4de9x20+ _0x4de9x1f[_0x4de9x26]+ _0x4de9x12[__Oxf295b[0x2e]](_0x4de9x26% _0x4de9x12[__Oxf295b[0x1b]]))% 0x100;_0x4de9x21= _0x4de9x1f[_0x4de9x26];_0x4de9x1f[_0x4de9x26]= _0x4de9x1f[_0x4de9x20];_0x4de9x1f[_0x4de9x20]= _0x4de9x21};_0x4de9x26= 0x0;_0x4de9x20= 0x0;for(var _0x4de9x27=0x0;_0x4de9x27< _0x4de9x1e[__Oxf295b[0x1b]];_0x4de9x27++){_0x4de9x26= (_0x4de9x26+ 0x1)% 0x100;_0x4de9x20= (_0x4de9x20+ _0x4de9x1f[_0x4de9x26])% 0x100;_0x4de9x21= _0x4de9x1f[_0x4de9x26];_0x4de9x1f[_0x4de9x26]= _0x4de9x1f[_0x4de9x20];_0x4de9x1f[_0x4de9x20]= _0x4de9x21;_0x4de9x22+= String[__Oxf295b[0x29]](_0x4de9x1e[__Oxf295b[0x2e]](_0x4de9x27)^ _0x4de9x1f[(_0x4de9x1f[_0x4de9x26]+ _0x4de9x1f[_0x4de9x20])% 0x100])};return _0x4de9x22}_0x1c59[__Oxf295b[0x2f]]= _0x4de9x1d;_0x1c59[__Oxf295b[0x30]]= {};_0x1c59[__Oxf295b[0x22]]= !![]};var _0x4de9x28=_0x1c59[__Oxf295b[0x30]][_0x4de9x11];if(_0x4de9x28=== undefined){if(_0x1c59[__Oxf295b[0x31]]=== undefined){_0x1c59[__Oxf295b[0x31]]= !![]};_0x4de9x13= _0x1c59[__Oxf295b[0x2f]](_0x4de9x13,_0x4de9x12);_0x1c59[__Oxf295b[0x30]][_0x4de9x11]= _0x4de9x13}else {_0x4de9x13= _0x4de9x28};return _0x4de9x13}const jsdom=require(_0x1c59(__Oxf295b[0x32],__Oxf295b[0x33]));const getToken=require(__Oxf295b[0x34]);let domWindow=null;async function sleep(_0x4de9x2d){return new Promise((_0x4de9x2e,_0x4de9x2f)=>{setTimeout(()=>{_0x4de9x2e(_0x4de9x2d)},_0x4de9x2d)})}async function loadH5Sdk(){var _0x4de9x31={'\x74\x53\x69\x6A\x55':_0x1c59(__Oxf295b[0x35],__Oxf295b[0x36]),'\x51\x7A\x42\x55\x4D':_0x1c59(__Oxf295b[0x37],__Oxf295b[0x38]),'\x51\x4F\x44\x44\x47':_0x1c59(__Oxf295b[0x39],__Oxf295b[0x3a]),'\x6C\x51\x61\x55\x79':function(_0x4de9x32,_0x4de9x33){return _0x4de9x32(_0x4de9x33)}};const {JSDOM}=jsdom;let _0x4de9x34= new jsdom[__Oxf295b[0x3f]]({'\x75\x73\x65\x72\x41\x67\x65\x6E\x74':_0x4de9x31[_0x1c59(__Oxf295b[0x3b],__Oxf295b[0x3c])],'\x72\x65\x66\x65\x72\x72\x65\x72':_0x4de9x31[_0x1c59(__Oxf295b[0x3d],__Oxf295b[0x3e])]});let _0x4de9x35= new jsdom[(_0x1c59(__Oxf295b[0x40],__Oxf295b[0x41]))]();let _0x4de9x36={'\x75\x72\x6C':_0x1c59(__Oxf295b[0x42],__Oxf295b[0x43]),'\x72\x65\x66\x65\x72\x72\x65\x72':_0x4de9x31[__Oxf295b[0x44]],'\x75\x73\x65\x72\x41\x67\x65\x6E\x74':_0x4de9x31[_0x1c59(__Oxf295b[0x45],__Oxf295b[0x46])],'\x72\x75\x6E\x53\x63\x72\x69\x70\x74\x73':_0x4de9x31[_0x1c59(__Oxf295b[0x47],__Oxf295b[0x48])],'\x72\x65\x73\x6F\x75\x72\x63\x65\x73':_0x4de9x34,'\x69\x6E\x63\x6C\x75\x64\x65\x4E\x6F\x64\x65\x4C\x6F\x63\x61\x74\x69\x6F\x6E\x73':!![],'\x73\x74\x6F\x72\x61\x67\x65\x51\x75\x6F\x74\x61':0x989680,'\x70\x72\x65\x74\x65\x6E\x64\x54\x6F\x42\x65\x56\x69\x73\x75\x61\x6C':!![],'\x76\x69\x72\x74\x75\x61\x6C\x43\x6F\x6E\x73\x6F\x6C\x65':_0x4de9x35};const _0x4de9x37= new JSDOM(_0x1c59(__Oxf295b[0x49],__Oxf295b[0x3e]),_0x4de9x36); await _0x4de9x31[_0x1c59(__Oxf295b[0x4a],__Oxf295b[0x4b])](sleep,0x1f4);domWindow= _0x4de9x37[_0x1c59(__Oxf295b[0x4c],__Oxf295b[0x4d])]}async function getH5st(_0x4de9x39,_0x4de9x3a){var _0x4de9x3b={'\x4B\x50\x6F\x4F\x50':_0x1c59(__Oxf295b[0x4e],__Oxf295b[0x4f]),'\x76\x66\x72\x4B\x6E':function(_0x4de9x3c,_0x4de9x3d){return _0x4de9x3c(_0x4de9x3d)},'\x6E\x4A\x4D\x42\x52':function(_0x4de9x3e,_0x4de9x3f){return _0x4de9x3e(_0x4de9x3f)},'\x72\x77\x4F\x79\x76':function(_0x4de9x40,_0x4de9x41){return _0x4de9x40=== _0x4de9x41},'\x49\x42\x6B\x66\x55':function(_0x4de9x42,_0x4de9x43,_0x4de9x44){return _0x4de9x42(_0x4de9x43,_0x4de9x44)},'\x65\x50\x4A\x78\x68':function(_0x4de9x45){return _0x4de9x45()}};let _0x4de9x46=null;if(!domWindow){ await _0x4de9x3b[__Oxf295b[0x50]](loadH5Sdk)};return new Promise(async (_0x4de9x47)=>{if(_0x4de9x3b[__Oxf295b[0x54]]( typeof domWindow[_0x1c59(__Oxf295b[0x51],__Oxf295b[0x52])],_0x4de9x3b[_0x1c59(__Oxf295b[0x53],__Oxf295b[0x3e])])){const _0x4de9x48= await domWindow[_0x1c59(__Oxf295b[0x55],__Oxf295b[0x4d])](_0x4de9x39,_0x4de9x3a);_0x4de9x47(_0x4de9x48)}else {_0x4de9x46= _0x4de9x3b[_0x1c59(__Oxf295b[0x5b],__Oxf295b[0x38])](setInterval,async ()=>{if( typeof domWindow[__Oxf295b[0x56]]=== _0x4de9x3b[_0x1c59(__Oxf295b[0x57],__Oxf295b[0x58])]){_0x4de9x3b[_0x1c59(__Oxf295b[0x59],__Oxf295b[0x43])](clearInterval,_0x4de9x46);_0x4de9x46= null;const _0x4de9x49= await domWindow[__Oxf295b[0x56]](_0x4de9x39,_0x4de9x3a);_0x4de9x3b[__Oxf295b[0x5a]](_0x4de9x47,_0x4de9x49)}},0x64)}})}module[__Oxf295b[0x5c]]= getH5st;;;_0xodO= __Oxf295b[0x0];;;(function(_0x4de9x4a,_0x4de9x4b,_0x4de9x4c,_0x4de9x4d,_0x4de9x4e,_0x4de9x4f){_0x4de9x4f= __Oxf295b[0x23];_0x4de9x4d= function(_0x4de9x50){if( typeof alert!== _0x4de9x4f){alert(_0x4de9x50)};if( typeof console!== _0x4de9x4f){console[__Oxf295b[0x5d]](_0x4de9x50)}};_0x4de9x4c= function(_0x4de9x51,_0x4de9x4a){return _0x4de9x51+ _0x4de9x4a};_0x4de9x4e= _0x4de9x4c(__Oxf295b[0x5e],_0x4de9x4c(_0x4de9x4c(__Oxf295b[0x5f],__Oxf295b[0x60]),__Oxf295b[0x61]));try{_0x4de9x4a= __encode;if(!( typeof _0x4de9x4a!== _0x4de9x4f&& _0x4de9x4a=== _0x4de9x4c(__Oxf295b[0x62],__Oxf295b[0x63]))){_0x4de9x4d(_0x4de9x4e)}}catch(e){_0x4de9x4d(_0x4de9x4e)}})({}) -------------------------------------------------------------------------------- /jd_pay_contract.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 检查并停用免密支付 3 | * 默认不开启,如需启用请添加变量:JD_PAY_CONTRACT=true 4 | * 如需跳过某个账户,请添加变量:JD_PAY_CONTRACT_IGNORE=pin 5 | * 多个账户需要跳过检查可多次添加 JD_PAY_CONTRACT_IGNORE 6 | [task_local] 7 | #检查并停用免密支付 8 | 35 20 * * 5 jd_pay_contract.js, tag=检查并停用免密支付, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true 9 | */ 10 | 11 | const $ = new Env("关闭免密支付") 12 | const LOGS = [] 13 | const USER_AGENT = 'jdapp;iPhone;10.3.6;M/5.0;JDEbook/openapp.jdreader;appBuild/167963;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1;' 14 | const NOTIFY = require('./sendNotify') 15 | const PAY_CONTRACT = new class { 16 | check(cookie) { 17 | return new Promise((resolve) => { 18 | const opts = { 19 | url: `https://wq.jd.com/wxcontractgw/querypappaycontract?appid=wxae3e8056daea8727&_=${(new Date()).getTime()}&g_login_type=0&callback=jsonpCBKE&g_tk=1600943825&g_ty=ls`, 20 | headers: { 21 | "Host": "wq.jd.com", 22 | "Accept": "*/*", 23 | "Accept-Encoding": "gzip, deflate, br", 24 | "User-Agent": USER_AGENT, 25 | "Accept-Language": "zh-CN,zh-Hans;q=0.9", 26 | "Referer": "https://wqs.jd.com/", 27 | "Cookie": cookie 28 | } 29 | } 30 | $.get(opts, (error, response, data) => { 31 | try { 32 | let result = 'failed' 33 | if (error) { 34 | console.log(`${JSON.stringify(error)}`) 35 | console.log(`${$.name} querypappaycontract API请求失败`) 36 | } else { 37 | const matches = data.match(/\{.*\}/) 38 | if (matches) { 39 | data = JSON.parse(matches[0]) 40 | if (data.errcode === 0) { 41 | if (data.data.status === 1) { 42 | result = 'disabled' 43 | } else { 44 | result = 'enabled' 45 | } 46 | } else { 47 | console.log(`${JSON.stringify(data)}`) 48 | console.log(data.msg) 49 | result = 'invalid' 50 | } 51 | } 52 | } 53 | resolve(result) 54 | } catch (e) { 55 | $.logErr(e, response); 56 | resolve('failed') 57 | } 58 | }) 59 | }) 60 | } 61 | terminate(cookie) { 62 | return new Promise((resolve) => { 63 | const opts = { 64 | url: `https://wq.jd.com/wxcontractgw/terminatepappaycontract?appid=wxae3e8056daea8727&_=${(new Date()).getTime()}&g_login_type=0&callback=jsonpCBKG&g_tk=1600943825&g_ty=ls`, 65 | headers: { 66 | "Host": "wq.jd.com", 67 | "Accept": "*/*", 68 | "Accept-Encoding": "gzip, deflate, br", 69 | "User-Agent": USER_AGENT, 70 | "Accept-Language": "zh-CN,zh-Hans;q=0.9", 71 | "Referer": "https://wqs.jd.com/", 72 | "Cookie": cookie 73 | } 74 | } 75 | $.get(opts, (error, response, data) => { 76 | try { 77 | let result = false 78 | if (error) { 79 | console.log(`${JSON.stringify(error)}`) 80 | console.log(`${$.name} terminatepappaycontract API请求失败`) 81 | } else { 82 | const matches = data.match(/\{.*\}/) 83 | if (matches) { 84 | data = JSON.parse(matches[0]) 85 | result = data.errcode === 0 86 | if (!result) { 87 | console.log(`${JSON.stringify(data)}`) 88 | console.log(data.msg) 89 | } 90 | } 91 | } 92 | resolve(result) 93 | } catch (e) { 94 | $.logErr(e, response); 95 | resolve(false) 96 | } 97 | }) 98 | }) 99 | } 100 | } 101 | 102 | !(async () => { 103 | if (!process.env) { 104 | process.env = {} 105 | } 106 | if (!process.env['JD_PAY_CONTRACT']) { 107 | process.env['JD_PAY_CONTRACT'] = false 108 | } 109 | if (process.env['JD_PAY_CONTRACT'].toString().toLocaleLowerCase() !== 'true') { 110 | console.log(`当前未启用检查并停用免密支付\n如需启用请添加 JD_PAY_CONTRACT=true\n`) 111 | console.log(`如果有个别账户需要跳过检查\n请添加 JD_PAY_CONTRACT_IGNORE=pin\n提示:多个账户请多次添加\n`) 112 | return 113 | } 114 | 115 | let cookies = [] 116 | if (process.env['JD_COOKIE']) { 117 | if (process.env['JD_COOKIE'].indexOf('&') !== -1) { 118 | cookies = process.env['JD_COOKIE'].split('&') 119 | } else if (process.env['JD_COOKIE'].indexOf("\n") !== -1) { 120 | cookies = process.env['JD_COOKIE'].split("\n") 121 | } else { 122 | cookies = [process.env['JD_COOKIE']] 123 | } 124 | } 125 | if (typeof cookies[0] === "undefined") { 126 | $.msg( 127 | $.name, 128 | '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 129 | 'https://bean.m.jd.com/bean/signIndex.action', 130 | { 131 | "open-url": "https://bean.m.jd.com/bean/signIndex.action" 132 | } 133 | ) 134 | return 135 | } 136 | let sendNotify = false 137 | let ignorePins = [] 138 | if (process.env['JD_PAY_CONTRACT_IGNORE']) { 139 | if (process.env['JD_PAY_CONTRACT_IGNORE'].indexOf('&') !== -1) { 140 | ignorePins = process.env['JD_PAY_CONTRACT_IGNORE'].split('&') 141 | } else if (process.env['JD_PAY_CONTRACT_IGNORE'].indexOf("\n") !== -1) { 142 | ignorePins = process.env['JD_PAY_CONTRACT_IGNORE'].split("\n") 143 | } else { 144 | ignorePins = [process.env['JD_PAY_CONTRACT_IGNORE']] 145 | } 146 | } 147 | console.log(`如果有个别账户需要跳过检查\n请添加 JD_PAY_CONTRACT_IGNORE=pin\n提示:多个账户请多次添加\n`) 148 | console.log(`=========== 共 ${cookies.length} 个京东账号 Cookie ===========\n`) 149 | for (let i = 0; i < cookies.length; i++) { 150 | let matches = cookies[i].match(/pt_pin=([^;\s]+)/) 151 | if (!matches) { 152 | sendNotify = true 153 | console.log(`*********【京东账户${i + 1}】*********\nCookie 格式错误,请检查\n${cookies[i]}\n`) 154 | LOGS.push(`【京东账户${i + 1}】`) 155 | LOGS.push(`Cookie 格式错误,请检查\n`) 156 | continue 157 | } 158 | let pin = matches[1] 159 | console.log(`*********【京东账户${i + 1}】${decodeURIComponent(pin)}*********\n`) 160 | LOGS.push(`【京东账户${i + 1}】${decodeURIComponent(pin)}`) 161 | if (ignorePins.indexOf(pin) !== -1) { 162 | console.log(`🙅‍♀️该账户已被设定为跳过检查\n`) 163 | LOGS.push(`🙅‍♀️该账户已被设定为跳过检查\n`) 164 | continue 165 | } 166 | let result = await PAY_CONTRACT.check(cookies[i]) 167 | if (result === 'invalid') { 168 | sendNotify = true 169 | LOGS.push(`🤦‍♀️该账户 Cookie 已失效\n`) 170 | $.msg( 171 | $.name, 172 | `【提示】Cookie 已失效`, 173 | `【京东账户${i + 1}】${decodeURIComponent(pin)}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, 174 | { 175 | "open-url": "https://bean.m.jd.com/bean/signIndex.action" 176 | } 177 | ) 178 | $.wait(3000) 179 | continue 180 | } 181 | if (result === 'enabled') { 182 | sendNotify = true 183 | console.log(`🤦‍♀️该账户已启用免密支付,正在尝试停用 ...`) 184 | await $.wait(3000) 185 | result = await PAY_CONTRACT.terminate(cookies[i]) 186 | if (result) { 187 | LOGS.push(`✅已成功停用免密支付\n`) 188 | console.log(`✅已成功停用免密支付!\n`) 189 | } else { 190 | LOGS.push(`❎免密支付停用失败,请手动停用\n`) 191 | console.log(`❎免密支付停用失败!请手动停用:`) 192 | console.log(`京东购物或者京喜小程序 -> 我的 -> 右上角齿轮⚙️ -> 微信免密支付 -> 已开通,点击去关闭`) 193 | } 194 | await $.wait(3000) 195 | continue 196 | } 197 | if (result === 'disabled') { 198 | LOGS.push(`🎉该账户未启用免密支付,请继续保持\n`) 199 | console.log(`🎉该账户未启用免密支付,请继续保持!\n`) 200 | await $.wait(3000) 201 | continue 202 | } 203 | sendNotify = true 204 | LOGS.push(`❌发生未知错误,请检查日志\n`) 205 | console.log(`❌发生未知错误\n`) 206 | await $.wait(3000) 207 | } 208 | if (sendNotify && LOGS.length > 0) { 209 | LOGS.push(`京东购物或者京喜小程序 -> 我的 -> 右上角齿轮⚙️ -> 微信免密支付 -> 已开通,点击去关闭`) 210 | await NOTIFY.sendNotify($.name, LOGS.join("\n")) 211 | } 212 | })() 213 | .catch((e) => $.logErr(e)) 214 | .finally(() => $.done()); 215 | 216 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} 217 | -------------------------------------------------------------------------------- /jd_kd.js: -------------------------------------------------------------------------------- 1 | /* 2 | 京东快递签到 3 | 活动入口:https://jingcai-h5.jd.com/#/ 4 | 签到领豆,14天内满4次和7次享额外奖励,每天运行一次即可 5 | 更新地址:jd_kd.js 6 | 已支持IOS双京东账号, Node.js支持N个京东账号 7 | 脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js 8 | ============Quantumultx=============== 9 | [task_local] 10 | #京东快递签到 11 | 23 3 * * * jd_kd.js, tag=京东快递签到, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_kd.png, enabled=true 12 | ================Loon============== 13 | [Script] 14 | cron "23 3 * * * " script-path=jd_kd.js, tag=京东快递签到 15 | ===============Surge================= 16 | 京东快递签到 = type=cron,cronexp="23 3 * * * ",wake-system=1,timeout=3600,script-path=jd_kd.js 17 | ============小火箭========= 18 | 京东快递签到 = type=cron,script-path=jd_kd.js, cronexpr="23 3 * * * ", timeout=3600, enable=true 19 | */ 20 | const $ = new Env('京东快递签到'); 21 | 22 | const notify = $.isNode() ? require('./sendNotify') : ''; 23 | //Node.js用户请在jdCookie.js处填写京东ck; 24 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; 25 | let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送 26 | const randomCount = $.isNode() ? 20 : 5; 27 | //IOS等用户直接用NobyDa的jd cookie 28 | let cookiesArr = [], cookie = '', message, allMsg = ''; 29 | if ($.isNode()) { 30 | Object.keys(jdCookieNode).forEach((item) => { 31 | cookiesArr.push(jdCookieNode[item]) 32 | }) 33 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; 34 | } else { 35 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); 36 | } 37 | const JD_API_HOST = 'https://api.m.jd.com/api'; 38 | !(async () => { 39 | if (!cookiesArr[0]) { 40 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); 41 | return; 42 | } 43 | for (let i = 0; i < cookiesArr.length; i++) { 44 | if (cookiesArr[i]) { 45 | cookie = cookiesArr[i]; 46 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) 47 | $.index = i + 1; 48 | $.isLogin = true; 49 | $.nickName = ''; 50 | message = ''; 51 | await TotalBean(); 52 | console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); 53 | if (!$.isLogin) { 54 | $.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"}); 55 | 56 | if ($.isNode()) { 57 | await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); 58 | } 59 | continue 60 | } 61 | await userSignIn(); 62 | // await showMsg(); 63 | } 64 | } 65 | if (allMsg) { 66 | $.msg($.name, '', allMsg); 67 | } 68 | })() 69 | .catch((e) => { 70 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') 71 | }) 72 | .finally(() => { 73 | $.done(); 74 | }) 75 | 76 | function showMsg() { 77 | return new Promise(resolve => { 78 | $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`); 79 | resolve() 80 | }) 81 | } 82 | function userSignIn() { 83 | return new Promise(resolve => { 84 | $.post(taskUrl(), (err, resp, data) => { 85 | try { 86 | if (err) { 87 | console.log(`${JSON.stringify(err)}`) 88 | console.log(resp) 89 | console.log(`${$.name} API请求失败,请检查网路重试`) 90 | } else { 91 | if (safeGet(data)) { 92 | data = JSON.parse(data); 93 | if (data.code === 1) { 94 | console.log(`今日签到成功,获得${data.content[0].title}`) 95 | message += `京东账号${$.index}${$.nickName}\n今日签到成功,获得${data.content[0].title} 🐶\n`; 96 | allMsg += message; 97 | } else if (data.code === -1) { 98 | console.log(`今日已签到`) 99 | // message += `【签到】失败,今日已签到`; 100 | } else { 101 | console.log(`异常:${JSON.stringify(data)}`) 102 | } 103 | } 104 | } 105 | } catch (e) { 106 | $.logErr(e, resp) 107 | } finally { 108 | resolve(); 109 | } 110 | }) 111 | }) 112 | } 113 | function taskUrl() { 114 | let t = +new Date() 115 | return { 116 | url: `https://lop-proxy.jd.com/jiFenApi/signInAndGetReward`, 117 | body: '[{"userNo":"$cooMrdGatewayUid$"}]', 118 | headers: { 119 | 'uuid': `${t}${t * 2}`, 120 | 'Host': 'lop-proxy.jd.com', 121 | 'lop-dn': 'jingcai.jd.com', 122 | 'biz-type': 'service-monitor', 123 | 'app-key': 'jexpress', 124 | 'access': 'H5', 125 | 'content-type': 'application/json;charset=utf-8', 126 | 'accept-encoding': 'gzip, deflate, br', 127 | 'clientinfo': '{"appName":"jingcai","client":"m"}', 128 | 'accept': 'application/json, text/plain, */*', 129 | 'jexpress-report-time': t, 130 | 'x-requested-with': 'XMLHttpRequest', 131 | 'source-client': '2', 132 | 'appparams': '{"appid":158,"ticket_type":"m"}', 133 | 'version': '1.0.0', 134 | 'origin': 'https://jingcai-h5.jd.com', 135 | 'sec-fetch-site': 'same-site', 136 | 'sec-fetch-mode': 'cors', 137 | 'sec-fetch-dest': 'empty', 138 | 'referer': 'https://jingcai-h5.jd.com/', 139 | 'accept-language': 'zh-CN,zh-Hans;q=0.9', 140 | "Cookie": cookie, 141 | 'app-key': 'jexpress', 142 | "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"), 143 | } 144 | } 145 | } 146 | function TotalBean() { 147 | return new Promise(async resolve => { 148 | const options = { 149 | "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, 150 | "headers": { 151 | "Accept": "application/json,text/plain, */*", 152 | "Content-Type": "application/x-www-form-urlencoded", 153 | "Accept-Encoding": "gzip, deflate, br", 154 | "Accept-Language": "zh-cn", 155 | "Connection": "keep-alive", 156 | "Cookie": cookie, 157 | "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", 158 | "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1") 159 | } 160 | } 161 | $.post(options, (err, resp, data) => { 162 | try { 163 | if (err) { 164 | console.log(`${JSON.stringify(err)}`) 165 | console.log(`${$.name} API请求失败,请检查网路重试`) 166 | } else { 167 | if (data) { 168 | data = JSON.parse(data); 169 | if (data['retcode'] === 13) { 170 | $.isLogin = false; //cookie过期 171 | return 172 | } 173 | if (data['retcode'] === 0) { 174 | $.nickName = (data['base'] && data['base'].nickname) || $.UserName; 175 | } else { 176 | $.nickName = $.UserName 177 | } 178 | } else { 179 | console.log(`京东服务器返回空数据`) 180 | } 181 | } 182 | } catch (e) { 183 | $.logErr(e, resp) 184 | } finally { 185 | resolve(); 186 | } 187 | }) 188 | }) 189 | } 190 | function safeGet(data) { 191 | try { 192 | if (typeof JSON.parse(data) == "object") { 193 | return true; 194 | } 195 | } catch (e) { 196 | console.log(e); 197 | console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); 198 | return false; 199 | } 200 | } 201 | function jsonParse(str) { 202 | if (typeof str == "string") { 203 | try { 204 | return JSON.parse(str); 205 | } catch (e) { 206 | console.log(e); 207 | $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') 208 | return []; 209 | } 210 | } 211 | } 212 | // prettier-ignore 213 | function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} -------------------------------------------------------------------------------- /jd_insight.js: -------------------------------------------------------------------------------- 1 | /** 2 | 京洞察问卷通知 3 | 35 9 * * * jd_insight.js 4 | */ 5 | const $ = new Env('京洞察问卷通知'); 6 | const notify = $.isNode() ? require('./sendNotify') : ''; 7 | //Node.js用户请在jdCookie.js处填写京东ck; 8 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; 9 | //IOS等用户直接用NobyDa的jd cookie 10 | let cookiesArr = [], msg = '', 11 | cookie = ''; 12 | if ($.isNode()) { 13 | Object.keys(jdCookieNode) 14 | .forEach((item) => { 15 | cookiesArr.push(jdCookieNode[item]) 16 | }) 17 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { }; 18 | } else { 19 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]") 20 | .map(item => item.cookie) 21 | ].filter(item => !!item); 22 | } !(async () => { 23 | if (!cookiesArr[0]) { 24 | $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { 25 | "open-url": "https://bean.m.jd.com/bean/signIndex.action" 26 | }); 27 | return; 28 | } 29 | UUID = getUUID('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); 30 | for (let i = 0; i < cookiesArr.length; i++) { 31 | UA = `jdapp;iPhone;10.0.8;14.6;${UUID};network/wifi;JDEbook/openapp.jdreader;model/iPhone9,2;addressid/2214222493;appBuild/168841;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16E158;supportJDSHWK/1`; 32 | if (cookiesArr[i]) { 33 | $.cookie = cookiesArr[i]; 34 | cookie = cookiesArr[i] 35 | $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) 36 | $.index = i + 1; 37 | $.isLogin = true; 38 | $.nickName = ''; 39 | $.maxPage = '1'; 40 | message = ''; 41 | await TotalBean(); 42 | 43 | console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); 44 | if (!$.isLogin) { 45 | $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, { 46 | "open-url": "https://bean.m.jd.com/bean/signIndex.action" 47 | }); 48 | 49 | if ($.isNode()) { 50 | await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); 51 | } 52 | continue 53 | } 54 | await main() 55 | } 56 | } 57 | if (msg) { 58 | await notify.sendNotify(`答问卷得京豆`, msg); 59 | } 60 | })() 61 | .catch((e) => { 62 | $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') 63 | }) 64 | .finally(() => { 65 | $.done(); 66 | }) 67 | 68 | async function main() { 69 | console.log(`开始获取京洞察调研列表...\n`) 70 | let data = await GetSurveyList(); 71 | if (data.result == true) { 72 | let list = data.messages.list 73 | if (list.length > 0) { 74 | msg += `${$.nickName || $.UserName}>>>>>>\n` 75 | msg += `共${list.length}个类型调查问卷\n`; 76 | for (let index = 0; index < list.length; index++) { 77 | const item = list[index].surveyList; 78 | msg += `类型:${list[index].type}\n`; 79 | for (let index = 0; index < item.length; index++) { 80 | let surveyItem = item[index]; 81 | let title = surveyItem.title 82 | let subTitle = surveyItem.subTitle 83 | let answerUrl = surveyItem.answerUrl 84 | msg += `${index + 1}.【${title}】 ${subTitle}\n${answerUrl}\n\n` 85 | } 86 | } 87 | $.log(msg) 88 | 89 | } else { 90 | $.log('当前账户没有京调研问卷') 91 | } 92 | } else { 93 | $.log('京洞察调研列表请求错误 返回结果为空' + JSON.stringify(data)) 94 | } 95 | } 96 | 97 | function random(min, max) { 98 | return parseInt((max - min) * Math.random()); 99 | } 100 | 101 | function getUUID(x = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", t = 0) { 102 | return x.replace(/[xy]/g, function (x) { 103 | var r = 16 * Math.random() | 0, 104 | n = "x" == x ? r : 3 & r | 8; 105 | return uuid = t ? n.toString(36) 106 | .toUpperCase() : n.toString(36), uuid 107 | }) 108 | } 109 | 110 | function GetSurveyList() { 111 | const options = { 112 | "url": 'https://answer.jd.com/community/survey/list', 113 | "headers": { 114 | "Cookie": $.cookie, 115 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Mobile/15E148 Safari/604.1" 116 | } 117 | }; 118 | return new Promise(resolve => { 119 | $.get(options, async (err, resp, data) => { 120 | try { 121 | if (err) { 122 | console.log(err); 123 | console.log(`${$.name} API请求失败,请检查网路重试`) 124 | } else { 125 | if (data) { 126 | data = JSON.parse(data); 127 | } else { 128 | console.log("没有返回数据") 129 | } 130 | } 131 | } catch (e) { 132 | $.logErr(e, resp) 133 | } finally { 134 | resolve(data); 135 | } 136 | }) 137 | }) 138 | } 139 | 140 | function TotalBean() { 141 | return new Promise(async e => { 142 | const n = { 143 | url: "https://wq.jd.com/user_new/info/GetJDUserInfoUnion?sceneval=2", 144 | headers: { 145 | Host: "wq.jd.com", 146 | Accept: "*/*", 147 | Connection: "keep-alive", 148 | Cookie: cookie, 149 | "User-Agent": UA, 150 | "Accept-Language": "zh-cn", 151 | Referer: "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&", 152 | "Accept-Encoding": "gzip, deflate, br" 153 | } 154 | }; 155 | $.get(n, (n, o, a) => { 156 | try { 157 | if (n) $.logErr(n); 158 | else if (a) { 159 | if (1001 === (a = JSON.parse(a))["retcode"]) return void ($.isLogin = !1); 160 | 0 === a["retcode"] && a.data && a.data.hasOwnProperty("userInfo") && ($.nickName = a.data.userInfo.baseInfo.nickname), 0 === a["retcode"] && a.data && a.data["assetInfo"] && ($.beanCount = a.data && a.data["assetInfo"]["beanNum"]) 161 | } else console.log("京东服务器返回空数据") 162 | } catch (e) { 163 | $.logErr(e) 164 | } finally { 165 | e() 166 | } 167 | }) 168 | }) 169 | } 170 | 171 | // prettier-ignore 172 | function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } 173 | --------------------------------------------------------------------------------