mirror of https://github.com/KingRan/KR.git
25 lines
132 KiB
JavaScript
25 lines
132 KiB
JavaScript
|
/*
|
|||
|
10.20-10.26 预售来袭 狂欢开抢
|
|||
|
开卡脚本,一次性脚本
|
|||
|
|
|||
|
//export jd_opencard_blacklist="" // 黑名单 用&隔开 pin值
|
|||
|
//export JD_LZ_OPENCARD="false" //关闭开卡相关活动运行
|
|||
|
//export opencard_draw="3" //抽奖次数 3
|
|||
|
————————————————
|
|||
|
入口:[ 10.20-10.26 预售来袭 狂欢开抢 ]
|
|||
|
|
|||
|
请求太频繁会被黑ip
|
|||
|
请更换IP后再执行脚本
|
|||
|
cron:11 11 11 11 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#10.20-10.26 预售来袭 狂欢开抢
|
|||
|
11 11 11 11 * jd_opencardL338.js, tag=10.20-10.26 预售来袭 狂欢开抢, enabled=true
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('10.20-10.26 预售来袭 狂欢开抢')
|
|||
|
var version_='jsjiami.com.v7';const iil11I11=iiIIlIii;(function(ilii1iIl,lI1IIII1,lIlII11l,II1lIiiI,iilil1,ilIillI1,iiiIIliI){return ilii1iIl=ilii1iIl>>0x8,ilIillI1='hs',iiiIIliI='hs',function(ii1I1il,IiIlll1I,l1ilIlIi,i11li,iii11I1){const liIi11li=iiIIlIii;i11li='tfi',ilIillI1=i11li+ilIillI1,iii11I1='up',iiiIIliI+=iii11I1,ilIillI1=l1ilIlIi(ilIillI1),iiiIIliI=l1ilIlIi(iiiIIliI),l1ilIlIi=0x0;const liIIII1I=ii1I1il();while(!![]&&--II1lIiiI+IiIlll1I){try{i11li=-parseInt(liIi11li(0x2a8,'2)Tf'))/0x1+parseInt(liIi11li(0x33e,'qFQx'))/0x2+parseInt(liIi11li(0x568,'4D5x'))/0x3+parseInt(liIi11li(0x18b,'2nq^'))/0x4+-parseInt(liIi11li(0x67b,'86SC'))/0x5+parseInt(liIi11li(0x1a3,'C[eF'))/0x6*(-parseInt(liIi11li(0x601,'e9%$'))/0x7)+-parseInt(liIi11li(0x6fa,'3vNg'))/0x8;}catch(i1ili1I){i11li=l1ilIlIi;}finally{iii11I1=liIIII1I[ilIillI1]();if(ilii1iIl<=II1lIiiI)l1ilIlIi?iilil1?i11li=iii11I1:iilil1=iii11I1:l1ilIlIi=iii11I1;else{if(l1ilIlIi==iilil1['replace'](/[BdLptTGDnyVfwHKXPNAhS=]/g,'')){if(i11li===IiIlll1I){liIIII1I['un'+ilIillI1](iii11I1);break;}liIIII1I[iiiIIliI](iii11I1);}}}}}(lIlII11l,lI1IIII1,function(i1IiIili,iiIiIiII,llIiII1l,l11iIiii,liiil11l,Iil1illl,lliilII1){return iiIiIiII='\x73\x70\x6c\x69\x74',i1IiIili=arguments[0x0],i1IiIili=i1IiIili[iiIiIiII](''),llIiII1l=`\x72\x65\x76\x65\x72\x73\x65`,i1IiIili=i1IiIili[llIiII1l]('\x76'),l11iIiii=`\x6a\x6f\x69\x6e`,(0x14380e,i1IiIili[l11iIiii](''));});}(0xc300,0xd9487,i1IIlIii,0xc5),i1IIlIii)&&(version_=i1IIlIii);const IlIIIIlI=$[iil11I11(0x3ec,'$u^)')]()?require('./jdCookie.js'):'',iiIlIII1=$['isNode']()?require(iil11I11(0x24f,'4nNm')):'';let Il1I1l1i=$['isNode']()?process[iil11I11(0x5d9,'EV7t')][iil11I11(0x313,'EV7t')]?process[iil11I11(0x29b,'sZPV')]['opencard_draw']:'0':$[iil11I11(0x354,']E#(')](iil11I11(0x54b,'ij^f'))?$[iil11I11(0x4a6,'DK1E')](iil11I11(0x49b,'5m!N')):'0',iIliIIIl=$['isNode']()?process[iil11I11(0x32f,'na]!')][iil11I11(0x15a,'CiUc')]?process[iil11I11(0x4e4,'e9%$')][iil11I11(0x395,'%*6f')]:![]:$[iil11I11(0x1d3,'$u^)')](iil11I11(0x60f,'z6d]'))?$[iil11I11(0x226,'0[)h')](iil11I11(0x1da,'(FFc')):![];const I1Il1Ii1=require(iil11I11(0x31a,']E#(')),ll111I=require('./function/krh5st'),I1i1Ill=require(iil11I11(0x524,'UFyF')),iiI1iIi=require(iil11I11(0x43e,'$IW5'));let Il1I111=iil11I11(0x489,'0[)h'),I1l1iIll=[],ll1111l='',li1lll11={};if($['isNode']()){Object[iil11I11(0x5f9,'kA2*')](IlIIIIlI)['forEach'](ll1iI1li=>{const ii1l1I=iil11I11;I1l1iIll[ii1l1I(0x647,'t7!B')](IlIIIIlI[ll1iI1li]);});if(process[iil11I11(0x397,'UFyF')][iil11I11(0x305,'$$yb')]&&process[iil11I11(0x2f8,']E#(')]['JD_DEBUG']===iil11I11(0x697,'DK1E'))console[iil11I11(0x189,'SWD4')]=()=>{};}else I1l1iIll=[$[iil11I11(0x4d6,'jutZ')](iil11I11(0x443,'IlOY')),$['getdata']('CookieJD2'),...IllIl11($[iil11I11(0x6aa,'%*6f')](iil11I11(0x1df,'UFS*'))||'[]')[iil11I11(0x4cc,'2nq^')](Ili111Ii=>Ili111Ii[iil11I11(0x375,'2nq^')])][iil11I11(0x3f5,'F36C')](lillIllI=>!!lillIllI);allMessage='',message='',$[iil11I11(0x219,'%*6f')]=![],$['outFlag']=![],$[iil11I11(0x510,'UTr!')]=![];let liIilill='',li1I1llI='',llill1li=process[iil11I11(0x32f,'na]!')][iil11I11(0x5f6,'$$yb')]?process['env'][iil11I11(0x5c3,'DK1E')]:iil11I11(0x613,'DK1E'),lIi1I1il='',liIIiI1l='';$['whitelist']=process['env'][iil11I11(0x332,'3vNg')]||lIi1I1il,$[iil11I11(0x622,'K)]n')]=process[iil11I11(0x1c9,'1dmT')][iil11I11(0x505,'q![f')]||liIIiI1l,Ii1I1IlI(),liI1IlIl(),$[iil11I11(0x559,'IlOY')]=[],!(async()=>{const i1iiiii1=iil11I11,l1iI1l1l={'ghrpF':i1iiiii1(0x241,'K)]n'),'WjTFC':i1iiiii1(0x5ef,'jutZ'),'EAygY':i1iiiii1(0x55f,'kjJA'),'CykYj':function(I11I,lllIi1I){return I11I!==lllIi1I;},'laVVY':i1iiiii1(0x4c2,'2)Tf'),'cBTrv':'DULSR','JqSIz':'https://bean.m.jd.com/','VREYO':function(illIllIl,i1IiII1i){return illIllIl(i1IiII1i);},'FfvPK':i1iiiii1(0x3c1,'3vNg'),'xblkw':'❖\x20测试连通性中...\x0a❖\x20服务状态正常...\x0a','RVkxw':i1iiiii1(0x38a,'FJAx'),'JhuFl':i1iiiii1(0x460,']E#('),'bJkpT':function(IiiillIi,iiili1Il,I11lIiiI){return IiiillIi(iiili1Il,I11lIiiI);},'PngCs':i1iiiii1(0x642,'sZPV'),'vqyma':function(IliI1lI1,lIi1IIIl){return IliI1lI1+lIi1IIIl;},'XRsxU':i
|
|||
|
// 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"])
|