KR/jd_zdjr.js

32 lines
96 KiB
JavaScript
Raw Normal View History

2022-02-11 16:56:14 +08:00
/*
一共有2个变量
jd_zdjr_activityId 活动ID 必需
jd_zdjr_activityUrl 活动地址 必需
已适配docker
需要配合重写获取=>活动id活动地址
https://\w+-isv.isvjcloud.com/wxTeam/shopInfo url script-request-body jd_zdjr.js
mitm
*-isv.isvjcloud.com
[task_local]
组队瓜分京豆
40 11 * * * jd_zdjr.js, tag=组队瓜分京豆, enabled=true
================Loon==============
[Script]
cron "40 11 * * *" script-path=jd_zdjr.js,tag=组队瓜分京豆
*/
let jd_zdjr_activityId = ''// 活动ID
let jd_zdjr_activityUrl = ''// 活动地址
var _0xodx='jsjiami.com.v6',_0x28b4=[_0xodx,'H8KcwqjCvsK1','VcOWw4cvaA==','wrXDvsK/CF4=','44O15o6v56eB44Ka6K+z5Yec6Iy65Y6x5Lib5LiI6LeD5Y2q5LmJw6nDqsKyw6jDusOpNeeYu+aOpOS+h+eWksKPVsO+w7JLV+ebs+S5qeS7ueespOWImOiOpuWPlQ==','IcOeVUUjw5EtXsOhwrXDvChBw6TDo8K0YMOPw48Dwr55','wqXDvgzDlxA=','wqI8OiA=','wp0xB8K6E8O3VsO0LARsAg==','TcOiw5EKZA==','YcKgwrXCrjU=','aAjCqXI=','w6lpwr0/w5IQwo3Cm8KNa8KKFg==','w6nDpsKeGMOU','w4HDh8Kkwq5Kwr4=','wpQ+UQ==','w4zDjFTCksKVwpoIY2c+wr9xw5vDoElYw7pPacKwPsOCwqkxI28LEE8/wqcUVEDDkHTDtARTw7gTUwoiwrfDrcKjw7LDkXrCp08gw69jwp82IMK2wp5/wqEDIsOtFUPDpcOfw5pMb8KzDGZdwrjCmMKZXCXDoQAlw5BsNw==','Zg1nwrvCsMOjw6/CqRM=','CMOINsOHSQvDqQzChUPDo20vV8KJahleKgJJwpNGw4bCqErCilPCuk3ChWHDmSI9w4V+wrPDlXjCiMKMwr7CpcO/e1E1fcOkIsKnamJ8w5tEasOhwpZ1RsOww5pgKcOcdMK/w6h+w7Y0','w5HCnQQ7OQ==','PBFnw7zDpw==','wqfDuCjDlwE=','wqrCthnDtA==','X8KECcKnw7I=','w40CA8KtYA==','WsK8wrM=','5b+d5bqhG+++pg==','RcKnwqbCrhpfwozDqyE=','w5XDp8KRwqbCtA==','TsKpEMKZQA==','woDCmcOsAsK2','fsOhwr4=','wpAGw6rDhMKGXOivqOayveWktOi2te++t+iupuaih+acpee8g+i0uOmGl+iuqQ==','wpvDnsKQw5trw63CnyAsw47CrcKrYwwww6xHCA==','LMOEVw==','d8Ogwq8=','w47DnH/CmMKCw4pVE2ctwqI2w4DCp1dFwoFeag==','w5vCsn3ChQ==','w7p8e1VJw5nDpA==','wpPDjcKADA==','ZMOvBcOqaSfDiHY=','wq5SQ8KRBA==','w5zCphY=','WMKfEMKrw7IoAwUS','wqDCtxnDtMO6WRU=','dcOhw4QoWw==','w5XCr23Cgg==','wpglOMK+Ow==','wrPCqRDDhcOW','w5/DkcKkwqwuwrvCs8Oww5PCsg==','w71jYD5FwpTDpsO2JcOVEzM=','wo4ke2rChVk=','woARwo0=','w7nCtjfCj8OsBxNgS8Khw6tuEQ==','w77DsMKewolQwp/CjcOGw6TCkC49wqk=','w7/Do8KgwoDCnE3DqA==','w4BaUcOowqY=','w607MMKuwr0=','w5HDsMKXwrFC','wqTCksOKDj8=','V8K0J2bCgiU0esKy','w5t7Rw==','M3zDvRg=','wrPDtkjDuT9Z','wp3DlcKow6R9w7U=','woXCsMOrDGg6w6EDw4vDlw==','DMOAKGjCgcKGwpLClcOjw57DqDg=','w71QdcOi','wrXDvU7DjD0QI143aXjCjgghQMKTwopNwpHDhsONw4nCvH3DgAPDp8KHMMKgwp0YRsOJwokZwprDjMKvLcKyw4bCiMKaw7fCpVsTw5bDjMKlQU1PdSdfAzfDkDPDq1wCMsKdwo4uDivCvcK1JjtTTRbDnX7Cvm/Cl3TCg8KuICfCtsKEwoDCucKpw4bDjMOKwo/CosOBw6XCn0HCoRZh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vJcOyADfChT9lJ8OBw47CiDAIwpPDi1PCtx0VFljChlpFw5XCq8KqMkzDuQnCssOaLMOkCMKZwqfDgWlsw5jCrlvDp8OwGk7CgMKjwqXCo8KGw5UONsKNNsK0w5nCnMOowrEvEVvDpsOtwrrDrMK9Y8KUw4vChAHCjQvDq2/Ctg==','DVDDmRpe','ZcKDwrHCgCQ=','Qi/Cs3AL','PcOPQFgewp5v','GcOVICvCosOdwpU=','5Lqa5ouP6Zibw7w=','worCicOsEcKN','w5zDs8Klwp9H','GcKkwqzChhdMwozDojZFG8O0w59zwqLCrnsgKVHDlV1NwqvDkMKJYw==','blBvw7Y7','wrp8AMKfHg==','Y8KSCsKsTA==','wqo3FcK/Kg==','a8ONw7gWSA==','UFxIw6Q6w4RGKMOawrBKwqPCu8KVcCPDqGNWwqzDn20IchTClg7Cn349bMKyw5zDqQ==','w49OwrIhw6s=','wp/CssO0McO5w4rCjsObdjTDn3TCtyfCosKDcA==','wrTCjsO+FMKT','wp7CmMOFCsKC','dAllwr7Ct8Onw6fCuwPCjgVLfmHDo8O1woEaw4sMYDfDtcKkw53DsMOEw7rDksKyw5Y4YA==','wpMuZWTClg==','R8OYFMOBSAA=','w67DvH/Ct8K1w6V1E0cJwpMRw6I=','w5wDHg==','w7rCk1vCo8ObbcKvM2zCoCrCoD8=','w7xjwok3bg==','wp3CsjXDpMOo','ScKPO17CiQ==','RMKnwozChDk=','exh4wrc=','wpc9Sw==','WMKZDMK/','wq/DuF3Djyg=','QMKhIW4=','w61DfF1+','AcKdwpbDlsKa','bR3CqWESBsOLVEjDt8Ouwqo=','wrEVZUxm','w6J4wqww','wp4iW0jCiFgCw5nDkcKkwrrCr8Kuw7E=','woM2QWQ=','NMO+dVPCtcOkw6p0wrVSw7nCjMK2Kg==','woYjQXfCtVM+w6zDmcKiwrHCnQ==','JsK7wqzDsQ==','wos0DMKZOcOy
// prettier-ignore
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"])