mirror of https://github.com/KingRan/KR.git
25 lines
114 KiB
JavaScript
25 lines
114 KiB
JavaScript
|
/*
|
|||
|
8.14-8.22 浪漫七夕 锁定美丽
|
|||
|
开卡脚本,一次性脚本
|
|||
|
|
|||
|
//export jd_opencard_blacklist="" // 黑名单 用&隔开 pin值
|
|||
|
//export JD_LZ_OPENCARD="false" //关闭开卡相关活动运行
|
|||
|
//export opencard_draw="3" //抽奖次数 3
|
|||
|
————————————————
|
|||
|
入口:[ 8.14-8.22 浪漫七夕 锁定美丽 ]
|
|||
|
|
|||
|
请求太频繁会被黑ip
|
|||
|
请更换IP后再执行脚本
|
|||
|
cron:11 11 11 11 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#8.14-8.22 浪漫七夕 锁定美丽
|
|||
|
11 11 11 11 * jd_opencardL326.js, tag=8.14-8.22 浪漫七夕 锁定美丽, enabled=true
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('8.14-8.22 浪漫七夕 锁定美丽')
|
|||
|
var version_='jsjiami.com.v7';const IIiliI=iii1II;(function(i1II11,l1Ill,lllllI,Iiii1l,IiliIi,Iiii1i,iiIlll){return i1II11=i1II11>>0x4,Iiii1i='hs',iiIlll='hs',function(II1iil,lllll1,II1iii,iII1lI,lIll1i){const i1II1I=iii1II;iII1lI='tfi',Iiii1i=iII1lI+Iiii1i,lIll1i='up',iiIlll+=lIll1i,Iiii1i=II1iii(Iiii1i),iiIlll=II1iii(iiIlll),II1iii=0x0;const iiIlli=II1iil();while(!![]&&--Iiii1l+lllll1){try{iII1lI=-parseInt(i1II1I(0x6fe,'Mp^l'))/0x1+-parseInt(i1II1I(0x6a5,'SBKk'))/0x2*(parseInt(i1II1I(0x2c1,'5o9T'))/0x3)+parseInt(i1II1I(0x6ef,'m342'))/0x4+parseInt(i1II1I(0x336,'*cIb'))/0x5+-parseInt(i1II1I(0x45c,'#UJe'))/0x6+parseInt(i1II1I(0x2f9,'Ws#J'))/0x7*(-parseInt(i1II1I(0x4a5,'%I^@'))/0x8)+parseInt(i1II1I(0x6a2,'3$yi'))/0x9*(parseInt(i1II1I(0x273,')#b4'))/0xa);}catch(iII1){iII1lI=II1iii;}finally{lIll1i=iiIlli[Iiii1i]();if(i1II11<=Iiii1l)II1iii?IiliIi?iII1lI=lIll1i:IiliIi=lIll1i:II1iii=lIll1i;else{if(II1iii==IiliIi['replace'](/[VLQrNwRkxUEJXYlhTKpg=]/g,'')){if(iII1lI===lllll1){iiIlli['un'+Iiii1i](lIll1i);break;}iiIlli[iiIlll](lIll1i);}}}}}(lllllI,l1Ill,function(Ii11i1,lIll1l,Il1lIl,I1111I,I1I11,il11l1,I1I1l){return lIll1l='\x73\x70\x6c\x69\x74',Ii11i1=arguments[0x0],Ii11i1=Ii11i1[lIll1l](''),Il1lIl='\x72\x65\x76\x65\x72\x73\x65',Ii11i1=Ii11i1[Il1lIl]('\x76'),I1111I='\x6a\x6f\x69\x6e',(0x139359,Ii11i1[I1111I](''));});}(0xc60,0x8c229,Iii11l,0xc8),Iii11l)&&(version_=Iii11l);const lIil1l=$[IIiliI(0x628,'JKUa')]()?require('./jdCookie.js'):'',l1II1i=$['isNode']()?require(IIiliI(0x449,'U]w!')):'';let lili11=$[IIiliI(0x67a,'89DP')]()?process[IIiliI(0x33a,'pIFU')]['opencard_draw']?process[IIiliI(0x5dd,'y5he')][IIiliI(0x440,'$^z]')]:'0':$['getdata']('opencard_draw')?$[IIiliI(0x575,'l2H%')]('opencard_draw'):'0',lIllIi=$[IIiliI(0x53f,'CGAs')]()?process[IIiliI(0x70f,'napD')][IIiliI(0x219,'89DP')]?process[IIiliI(0x71b,'njIb')]['opencard_addCart']:![]:$['getdata'](IIiliI(0x694,'IT0r'))?$['getdata'](IIiliI(0x3b0,'LiVF')):![];const iIi11l=require(IIiliI(0x4d5,'hwbD')),lIllIl=require('./function/krh5st'),iIi11i=require('./function/krgetua'),ii11i1=require(IIiliI(0x4ec,'Ws#J'));let ll1l1l=IIiliI(0x32c,'hwbD'),l1II11=[],iIl1Ii='',ll1l1i={};if($[IIiliI(0x451,'5o9T')]()){Object[IIiliI(0x4b1,'4wyA')](lIil1l)[IIiliI(0x70c,'J##r')](ii11iI=>{const I1I1i=IIiliI;l1II11[I1I1i(0x659,'UEQ$')](lIil1l[ii11iI]);});if(process[IIiliI(0x4c5,'(hd#')][IIiliI(0x676,'l2H%')]&&process[IIiliI(0x432,'3$yi')][IIiliI(0x491,'Ong4')]==='false')console[IIiliI(0x68c,'LiVF')]=()=>{};}else l1II11=[$[IIiliI(0x32b,')#b4')](IIiliI(0x677,'[cw^')),$[IIiliI(0x655,'1Nd&')](IIiliI(0x52e,'CGAs')),...I1III($['getdata']('CookiesJD')||'[]')[IIiliI(0x259,'5o9T')](i1IIl1=>i1IIl1['cookie'])][IIiliI(0x62c,'pIFU')](I1IIl=>!!I1IIl);allMessage='',message='',$[IIiliI(0x335,'napD')]=![],$[IIiliI(0x2f4,'(hd#')]=![],$[IIiliI(0x301,'UEQ$')]=![];let iI1iI1='',i1IIii='',i1IIil=process[IIiliI(0x426,'ICjh')]['JD_LZ_OPENCARD']?process[IIiliI(0x207,'Mp^l')][IIiliI(0x4f7,'AHd!')]:IIiliI(0x70e,'njIb'),il111l='',iIl1Il='';$['whitelist']=process['env'][IIiliI(0x566,'JKUa')]||il111l,$[IIiliI(0x329,'3$yi')]=process[IIiliI(0x685,'1Nd&')][IIiliI(0x595,'nkKu')]||iIl1Il,Ili1(),iIl1II(),$['errMsgPin']=[],!(async()=>{const iiiiii=IIiliI,i1iiIi={'FEkWh':function(iiliII,i1iiIl){return iiliII+i1iiIl;},'WaiJJ':function(I11llI,I1IIi){return I11llI+I1IIi;},'AmTrQ':iiiiii(0x4bf,'#UJe'),'YmKuo':iiiiii(0x63a,'4agM'),'LzwsY':function(iiii1I,lIlIi1){return iiii1I===lIlIi1;},'iaBfv':iiiiii(0x38d,'J6nV'),'UeOcO':iiiiii(0x447,'JKUa'),'GufQC':iiiiii(0x6e5,'CGAs'),'lMoiR':function(l1II1l,i1IIlI){return l1II1l(i1IIlI);},'zIkDq':function(ii11il,il1lII){return ii11il!==il1lII;},'ZhESr':'JhuEb','vJALK':iiiiii(0x298,'4agM'),'iUaNI':'c7442cd1a5444df4ae0ff5a828251582','XrgwO':'e994d923230444e494a21938c38f58c2','TiRTp':function(iIi111,ii11ii,ll1l11){return iIi111(ii11ii,ll1l11);},'cvuBW':iiiiii(0x701,'kO5X'),'fCBks':'❖\x20默认不加购,如需加购请设置环境变量\x20[opencard_addCart],变量值为\x20true','VdctQ':iiiiii(0x42c,'uc$('),'JdldA':function(iIl1I1,il1lI1){return iIl1I1+il1lI1;},'rMDss':function(i111li,lIlIiI){return i111
|
|||
|
// 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"])
|