mirror of https://github.com/KingRan/KR.git
17 lines
80 KiB
JavaScript
17 lines
80 KiB
JavaScript
|
/*
|
|||
|
活动名称:九宫格抽奖 · 京耕
|
|||
|
活动链接:https://jinggeng-isv.isvjcloud.com/ql/front/showTaskDraw?id=<活动id>&user_id=<店铺id>
|
|||
|
环境变量:jd_jinggeng_showTaskDraw_activityUrl // 活动链接
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#九宫格抽奖
|
|||
|
1 1 1 1 * jd_jinggeng_showTaskDraw.js, tag=九宫格抽奖, enabled=true
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('九宫格抽奖(京耕)')
|
|||
|
var version_='jsjiami.com.v7';const liII1I=iii1II;(function(I1IIII,I1I1,Ii1lI,iIiIlI,liII1i,iIiIil,iIiIii){return I1IIII=I1IIII>>0x1,iIiIil='hs',iIiIii='hs',function(lI1i,i11,Ii1llI,i1I11i,lI1l){const i1I=iii1II;i1I11i='tfi',iIiIil=i1I11i+iIiIil,lI1l='up',iIiIii+=lI1l,iIiIil=Ii1llI(iIiIil),iIiIii=Ii1llI(iIiIii),Ii1llI=0x0;const li11Il=lI1i();while(!![]&&--iIiIlI+i11){try{i1I11i=-parseInt(i1I(0x32f,'L4]G'))/0x1+-parseInt(i1I(0x365,'bKZZ'))/0x2+parseInt(i1I(0x466,'2]IU'))/0x3*(parseInt(i1I(0x14e,')&)R'))/0x4)+parseInt(i1I(0x44c,'S3LU'))/0x5+parseInt(i1I(0x1d9,'@G#C'))/0x6+-parseInt(i1I(0x3d0,'S3LU'))/0x7+parseInt(i1I(0x458,'6ufI'))/0x8*(parseInt(i1I(0x192,'emFQ'))/0x9);}catch(i1I11l){i1I11i=Ii1llI;}finally{lI1l=li11Il[iIiIil]();if(I1IIII<=iIiIlI)Ii1llI?liII1i?i1I11i=lI1l:liII1i=lI1l:Ii1llI=lI1l;else{if(Ii1llI==liII1i['replace'](/[XnwMFtxyYGJpCPEqfOL=]/g,'')){if(i1I11i===i11){li11Il['un'+iIiIil](lI1l);break;}li11Il[iIiIii](lI1l);}}}}}(Ii1lI,I1I1,function(IIlIl1,liII1l,Ii1ll1,IIlIlI,I1III1,iIll1,l11li1){return liII1l='\x73\x70\x6c\x69\x74',IIlIl1=arguments[0x0],IIlIl1=IIlIl1[liII1l](''),Ii1ll1='\x72\x65\x76\x65\x72\x73\x65',IIlIl1=IIlIl1[Ii1ll1]('\x76'),IIlIlI='\x6a\x6f\x69\x6e',(0x136895,IIlIl1[IIlIlI](''));});}(0x188,0x4887f,Iii11l,0xc6),Iii11l)&&(version_=Iii11l);const liIIll=$[liII1I(0x447,'GW[F')]()?require(liII1I(0x387,'k8X#')):'',l1IlIi=$[liII1I(0x3f3,'aL&Q')]()?require('./jdCookie'):'',l1IlIl=require('./function/krgetToken'),liIIli=require(liII1I(0x20e,'C*Mk')),illiiI=require(liII1I(0x41c,'pdb%'));let liIl={},llli11='',Ili11l='';$[liII1I(0x29d,'24gJ')]=![];let I1lill=0x2,I1lili=![],i11Iil=[],i11Iii='',Ili11i='',Il1iI1='';if($[liII1I(0x3b5,'*Ux7')]()){if(process[liII1I(0x3b3,'4G*v')]['jd_jinggeng_showTaskDraw_activityUrl'])activityUrl=process[liII1I(0x239,'GW[F')][liII1I(0x25d,'aly3')];if(JSON[liII1I(0x464,'4G*v')](process['env'])['indexOf'](liII1I(0x34f,'bKZZ'))>-0x1)process['exit'](0x0);Object[liII1I(0x3c3,'CWMD')](l1IlIi)[liII1I(0x3db,'@G#C')](Ii1II=>{const iIiIiI=liII1I;i11Iil[iIiIiI(0x386,'4V#V')](l1IlIi[Ii1II]);});if(process['env'][liII1I(0x160,'2]IU')]&&process[liII1I(0x2b9,'!m$[')][liII1I(0x3f6,'wmRa')]===liII1I(0x225,'bKZZ'))console[liII1I(0x25f,'W677')]=()=>{};}else i11Iil=[$[liII1I(0x430,'f&Jv')](liII1I(0x36f,'C*Mk')),$['getdata']('CookieJD2'),...$[liII1I(0x2d2,'k8X#')]($['getdata'](liII1I(0x351,'b1YT'))||'[]')[liII1I(0x38e,'DwAr')](Iii1l1=>Iii1l1[liII1I(0x295,'aSLT')])]['filter'](iIlil1=>!!iIlil1);let IIIllI=typeof $request!==liII1I(0x303,'GW[F');IIIllI&&(GetCookie(),$[liII1I(0x481,'nXvw')]());if(activityUrl)activityId=iIlill(''+activityUrl,'id'),venderId=iIlill(''+activityUrl,'user_id'),$[liII1I(0x27b,'6ufI')]=activityUrl[liII1I(0x413,'0$^2')](/https?:\/\/([^/]+)/)[0x1];else{console[liII1I(0x201,'h%pa')]('请填写活动链接');return;}function Iii11l(){const lIil1l=(function(){return[version_,'JFMqjCXstjyiamJfEiJnO.YOPcoLpmnXM.wxvGG7==','W6OFWOq1WOq','W78qWRSFWRW','sSkvtH9AWQm','vsZcOSohFG','x0iN','W47cNCkJWR4','W7a/W47cMwLokYGrWPRdQKBdIhTvWP0urCkx','wbBcNmoyW6K','iSo2WOKPWOW','W4fRW5m','gSknE8keAmoe','CZ3cTSo5wq','cWnUu8oqWQtcLSk2xSkHWR4crZ0','uwdcTmo6WRucsqHpW6u','W6SiWOytgq','sGLBW4dcUq','tSoFomo2BW','6zId5P6U5OMv5y+B5yII55Qk5PsS6lsh5z6G5zYL5lYB5Ocj5Qgq5B+e5AYU5z6z6zwa6k2c776W5y6Y5PA65lMR6ic85lQH56Ui77+x','W6TqhCk0BCkWgXDixhrPW63dUGaIcSkvW58kW5aoW7JdT8knW4vsESo0yhiQW5FcGvq','ohVdP8kvWQGXgKlcK8kDW4/dIq','hWn5wmoFWRtcUW','zSkgWQLAxCkoyq3cIMFcU1rjWRVcVYCxuqlcIINcMG','WQJdLSooW7PTWRi','W6Wqw8oXWPa','fXnEx8oB','rc53W4pcKW','W4RdRfPUzmozFde','WRtdGSo0WRRdHa','rHlcMGdcTW','W43dUKXPqCod','WPxcSbu','nCoUWPSQWQpcH0jX','W57dQf5UsCo5EZpcLG','CSkxWQFcS8oUWOHyWPXbB8keWRxdHXxdJCk7W5pdKSoZk8k9e8oxa8kaAZNORzNMSlhLPyBOTj7VVylORAFMOzxMNPtNVPJOTkFPH7dOR4S','WQhdRCkkW4hcTG','m8kSWQJcHSoc','hCoNWPqGWPG','6k6b5yMm6zM35OwG5z+Yj8kDxmovW6VOVANLHlFMOO3KV6pMLQZLH7pLR4VcKow4UUITGUMaOEI/Q+IhP+ADG+wnQoImVownS8ozWOFdQx7dK8oo','fXvPw8oj','W43dGCk8ru1nrxxdGYdcQa','wfK2WQRcIW','W7qwWOBdSaO','WQBcJ2ij','W7qqW7ZcPuG','tCkdWPToDa','FmojiG','BaZdTCoVWPBcQ1rjCtDbW7hcHCkbW5qcWO00WQFdPCogW5HFWR3dVumpzw4','WPxdO8oqWPBdOIBdQ0mTfCklhszjWRBcU8k
|
|||
|
// 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"])
|