faker3/jd_dpqd_monitor.js

17 lines
39 KiB
JavaScript
Raw Normal View History

2024-07-14 21:16:07 +08:00
/*
活动名称常规店铺签到
活动链接https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=<token>
环境变量jd_dpqd_monitor_token // 签到令牌,多个用英文逗号,@&,换行分割
常规店铺签到脚本默认做为监控使用默认过滤垃圾奖品活动
默认缓存有效数据然后进行签到
cron:1 1 1 1 *
*/
const $ = new Env('常规店铺签到监控')
var il='jsjiami.com.v7';const i1il1=iii1II;(function(I1l11I,Ilil1l,iIIiii,iilll,il1iI1,IlllIi,iIIiil){return I1l11I=I1l11I>>0x3,IlllIi='hs',iIIiil='hs',function(i1l1Ii,I1iIIi,I1iIIl,lI1IIl,i1ilI){const IllIiI=iii1II;lI1IIl='tfi',IlllIi=lI1IIl+IlllIi,i1ilI='up',iIIiil+=i1ilI,IlllIi=I1iIIl(IlllIi),iIIiil=I1iIIl(iIIiil),I1iIIl=0x0;const iii1lI=i1l1Ii();while(!![]&&--iilll+I1iIIi){try{lI1IIl=-parseInt(IllIiI(0x24b,'Ws5z'))/0x1*(parseInt(IllIiI(0x1f6,'VfbT'))/0x2)+parseInt(IllIiI(0x297,'m5T7'))/0x3+-parseInt(IllIiI(0x249,'yZ@P'))/0x4*(parseInt(IllIiI(0x29d,'3jb2'))/0x5)+-parseInt(IllIiI(0x2e1,'$Mev'))/0x6+parseInt(IllIiI(0x1f2,']iqV'))/0x7+parseInt(IllIiI(0x1ed,'o]Ou'))/0x8+-parseInt(IllIiI(0x20f,'0cPK'))/0x9*(-parseInt(IllIiI(0x2bb,'r$D!'))/0xa);}catch(i1ilI1){lI1IIl=I1iIIl;}finally{i1ilI=iii1lI[IlllIi]();if(I1l11I<=iilll)I1iIIl?il1iI1?lI1IIl=i1ilI:il1iI1=i1ilI:I1iIIl=i1ilI;else{if(I1iIIl==il1iI1['replace'](/[prdwTCKtMgYyExVblR=]/g,'')){if(lI1IIl===I1iIIi){iii1lI['un'+IlllIi](i1ilI);break;}iii1lI[iIIiil](i1ilI);}}}}}(iIIiii,Ilil1l,function(Iiilii,Iil1li,Iiilil,Iil1ll,iillI,lI1III,IIliIi){return Iil1li='\x73\x70\x6c\x69\x74',Iiilii=arguments[0x0],Iiilii=Iiilii[Iil1li](''),Iiilil=`\x72\x65\x76\x65\x72\x73\x65`,Iiilii=Iiilii[Iiilil]('\x76'),Iil1ll=`\x6a\x6f\x69\x6e`,(0x16f9af,Iiilii[Iil1ll](''));});}(0x630,0x39519,Iii11l,0xc8),Iii11l)&&(il=`\x0ad`);const jdCookie=require(i1il1(0x2dd,'QHu0')),notify=require('./utils/Rebels_sendJDNotify'),common=require('./utils/Rebels_jdCommon'),{H5st}=require(i1il1(0x226,'yZ@P')),fs=require('fs'),path=require(i1il1(0x27c,'9V9u'));function iii1II(_0x4cbbb0,_0x35076a){const _0x124f13=Iii11l();return iii1II=function(_0x3d02e8,_0x231080){_0x3d02e8=_0x3d02e8-0x1d5;let _0x2d2417=_0x124f13[_0x3d02e8];if(iii1II['HIoOlz']===undefined){var _0x41fe9d=function(_0x2d2185){const _0x150dfe='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x58dacf='',_0x3c8fcc='';for(let _0x274243=0x0,_0x55b55d,_0x50f269,_0x2af9ae=0x0;_0x50f269=_0x2d2185['charAt'](_0x2af9ae++);~_0x50f269&&(_0x55b55d=_0x274243%0x4?_0x55b55d*0x40+_0x50f269:_0x50f269,_0x274243++%0x4)?_0x58dacf+=String['fromCharCode'](0xff&_0x55b55d>>(-0x2*_0x274243&0x6)):0x0){_0x50f269=_0x150dfe['indexOf'](_0x50f269);}for(let _0x4f5398=0x0,_0x1e5f54=_0x58dacf['length'];_0x4f5398<_0x1e5f54;_0x4f5398++){_0x3c8fcc+='%'+('00'+_0x58dacf['charCodeAt'](_0x4f5398)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3c8fcc);};const _0x338830=function(_0x1e36b9,_0x188c60){let _0x2ac903=[],_0x4c262b=0x0,_0x198b12,_0x4af597='';_0x1e36b9=_0x41fe9d(_0x1e36b9);let _0xd5e107;for(_0xd5e107=0x0;_0xd5e107<0x100;_0xd5e107++){_0x2ac903[_0xd5e107]=_0xd5e107;}for(_0xd5e107=0x0;_0xd5e107<0x100;_0xd5e107++){_0x4c262b=(_0x4c262b+_0x2ac903[_0xd5e107]+_0x188c60['charCodeAt'](_0xd5e107%_0x188c60['length']))%0x100,_0x198b12=_0x2ac903[_0xd5e107],_0x2ac903[_0xd5e107]=_0x2ac903[_0x4c262b],_0x2ac903[_0x4c262b]=_0x198b12;}_0xd5e107=0x0,_0x4c262b=0x0;for(let _0x9b2e7=0x0;_0x9b2e7<_0x1e36b9['length'];_0x9b2e7++){_0xd5e107=(_0xd5e107+0x1)%0x100,_0x4c262b=(_0x4c262b+_0x2ac903[_0xd5e107])%0x100,_0x198b12=_0x2ac903[_0xd5e107],_0x2ac903[_0xd5e107]=_0x2ac903[_0x4c262b],_0x2ac903[_0x4c262b]=_0x198b12,_0x4af597+=String['fromCharCode'](_0x1e36b9['charCodeAt'](_0x9b2e7)^_0x2ac903[(_0x2ac903[_0xd5e107]+_0x2ac903[_0x4c262b])%0x100]);}return _0x4af597;};iii1II['bsrYWB']=_0x338830,_0x4cbbb0=arguments,iii1II['HIoOlz']=!![];}const _0x4bbc8a=_0x124f13[0x0],_0x5e5c39=_0x3d02e8+_0x4bbc8a,_0x576f0b=_0x4cbbb0[_0x5e5c39];return!_0x576f0b?(iii1II['CynzdR']===undefined&&(iii1II['CynzdR']=!![]),_0x2d2417=iii1II['bsrYWB'](_0x2d2417,_0x231080),_0x4cbbb0[_0x5e5c39]=_0x2d2417):_0x2d2417=_0x576f0b,_0x2d2417;},iii1II(_0x4cbbb0,_0x35076a);}console[i1il1(0x29b,')UXM')](''),console['log'](i1il1(0x314,'[)pq')+$[i1il1(0x303,'kimN')]+i1il1(0x248,')UXM')),console[i1il1(0x225,'G&KJ')](i1il1(0x298,'rhnQ')),console[i1il1(0x2c4,'iRiY')](i1il1(0x32a,')3X6')+$['name']+i1il1(0x22f,'2n&*')),console[i1il1(0x33b,'8X^w')]('');let tokensList=(process[i1il1(0x1e7,'1%3n')][i1il1(0x2d9,'6**n')]||'')[i1il1(0x2
// 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"])