mirror of https://github.com/KingRan/KR.git
25 lines
129 KiB
JavaScript
25 lines
129 KiB
JavaScript
|
/*
|
|||
|
10.17-10.24 五谷丰收季 好物奇遇礼
|
|||
|
开卡脚本,一次性脚本
|
|||
|
|
|||
|
//export jd_opencard_blacklist="" // 黑名单 用&隔开 pin值
|
|||
|
//export JD_LZ_OPENCARD="false" //关闭开卡相关活动运行
|
|||
|
//export opencard_draw="3" //抽奖次数 3
|
|||
|
————————————————
|
|||
|
入口:[ 10.17-10.24 五谷丰收季 好物奇遇礼 ]
|
|||
|
|
|||
|
请求太频繁会被黑ip
|
|||
|
请更换IP后再执行脚本
|
|||
|
cron:11 11 11 11 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#10.17-10.24 五谷丰收季 好物奇遇礼
|
|||
|
11 11 11 11 * jd_opencardL337.js, tag=10.17-10.24 五谷丰收季 好物奇遇礼, enabled=true
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('10.17-10.24 五谷丰收季 好物奇遇礼')
|
|||
|
var version_='jsjiami.com.v7';const Ii1II11l=lilIiIlI;(function(II1i111,lilIl1i,lIi11iI,IIllllII,liIi1ilI,Iili11II,llilI1I1){return II1i111=II1i111>>0x9,Iili11II='hs',llilI1I1='hs',function(i1liiII1,lI1il1II,ilI1l1li,ii1iiii,lliI1lII){const I1I1llIl=lilIiIlI;ii1iiii='tfi',Iili11II=ii1iiii+Iili11II,lliI1lII='up',llilI1I1+=lliI1lII,Iili11II=ilI1l1li(Iili11II),llilI1I1=ilI1l1li(llilI1I1),ilI1l1li=0x0;const I1ii1ilI=i1liiII1();while(!![]&&--IIllllII+lI1il1II){try{ii1iiii=-parseInt(I1I1llIl(0x3a4,'l5vb'))/0x1*(parseInt(I1I1llIl(0x54b,'Gukg'))/0x2)+-parseInt(I1I1llIl(0x1e3,'$h3r'))/0x3*(-parseInt(I1I1llIl(0x22b,'F[K('))/0x4)+-parseInt(I1I1llIl(0x1d4,'[nd)'))/0x5*(parseInt(I1I1llIl(0x233,'M*eE'))/0x6)+parseInt(I1I1llIl(0x227,'NIRb'))/0x7+-parseInt(I1I1llIl(0x26d,'7Hw%'))/0x8*(-parseInt(I1I1llIl(0x1f8,'RfAk'))/0x9)+-parseInt(I1I1llIl(0x2da,'@R]w'))/0xa*(-parseInt(I1I1llIl(0x299,'lW!Z'))/0xb)+parseInt(I1I1llIl(0x40c,')mEG'))/0xc*(-parseInt(I1I1llIl(0x36e,'r&!a'))/0xd);}catch(IIII1i1){ii1iiii=ilI1l1li;}finally{lliI1lII=I1ii1ilI[Iili11II]();if(II1i111<=IIllllII)ilI1l1li?liIi1ilI?ii1iiii=lliI1lII:liIi1ilI=lliI1lII:ilI1l1li=lliI1lII;else{if(ilI1l1li==liIi1ilI['replace'](/[dyRhJpeuOrKLMXfEtgPGw=]/g,'')){if(ii1iiii===lI1il1II){I1ii1ilI['un'+Iili11II](lliI1lII);break;}I1ii1ilI[llilI1I1](lliI1lII);}}}}}(lIi11iI,lilIl1i,function(iilli1ll,Il11II1i,IlIlllI,liliIlII,ilIII1il,IlI11il1,ii1I1il1){return Il11II1i='\x73\x70\x6c\x69\x74',iilli1ll=arguments[0x0],iilli1ll=iilli1ll[Il11II1i](''),IlIlllI=`\x72\x65\x76\x65\x72\x73\x65`,iilli1ll=iilli1ll[IlIlllI]('\x76'),liliIlII=`\x6a\x6f\x69\x6e`,(0x142e4d,iilli1ll[liliIlII](''));});}(0x18a00,0xe07ea,I111I1I,0xc7),I111I1I)&&(version_=I111I1I);const I1I1Iiil=$['isNode']()?require(Ii1II11l(0x3bb,'Gukg')):'',iillll1l=$['isNode']()?require('./sendNotify'):'';let Iii1iiii=$[Ii1II11l(0x274,'g(k9')]()?process['env']['opencard_draw']?process['env'][Ii1II11l(0x21b,'dWzB')]:'0':$[Ii1II11l(0x66f,')mEG')](Ii1II11l(0x447,'E7aF'))?$[Ii1II11l(0x63f,'x6MX')]('opencard_draw'):'0',Iliil1i=$[Ii1II11l(0x456,'k3Yj')]()?process[Ii1II11l(0x4f8,'E7aF')][Ii1II11l(0x2bf,'o^ko')]?process['env']['opencard_addCart']:![]:$[Ii1II11l(0x429,'[nd)')](Ii1II11l(0x685,'!Pq$'))?$['getdata']('opencard_addCart'):![];const IlIll1l=require(Ii1II11l(0x2f9,'k3Yj')),ll11I1i1=require('./function/krh5st'),iilii1lI=require(Ii1II11l(0x347,'5A%1')),iIlI1iiI=require('./function/krwxSavePrize');let i1ll1iil=Ii1II11l(0x5c1,'QjT2'),lIIlIli=[],IlI111il='',IiilIIi={};if($[Ii1II11l(0x274,'g(k9')]()){Object['keys'](I1I1Iiil)['forEach'](l1iI1l=>{const Il11Illl=Ii1II11l;lIIlIli[Il11Illl(0x4bd,'l5vb')](I1I1Iiil[l1iI1l]);});if(process[Ii1II11l(0x368,'ZC]E')]['JD_DEBUG']&&process[Ii1II11l(0x688,'Gukg')][Ii1II11l(0x27e,'$EQH')]===Ii1II11l(0x52f,'r&!a'))console[Ii1II11l(0x61a,'tH6P')]=()=>{};}else lIIlIli=[$[Ii1II11l(0x47c,'uo3e')](Ii1II11l(0x627,'wKuG')),$['getdata'](Ii1II11l(0x5f0,'$EQH')),...lilliI11($['getdata'](Ii1II11l(0x3df,'NIRb'))||'[]')[Ii1II11l(0x4ee,'RfAk')](IliI1iIl=>IliI1iIl[Ii1II11l(0x387,'C6M*')])][Ii1II11l(0x3b4,'r&!a')](I1I1111I=>!!I1I1111I);allMessage='',message='',$[Ii1II11l(0x5dc,'[nd)')]=![],$[Ii1II11l(0x37c,'x6MX')]=![],$[Ii1II11l(0x2a9,'$EQH')]=![];let lll11ii1='',l1iiill='',IIlil1I1=process[Ii1II11l(0x21d,'p8ne')][Ii1II11l(0x487,')mEG')]?process[Ii1II11l(0x51b,'r&!a')][Ii1II11l(0x497,'tb0I')]:'true',Ii1il1iI='',lIiIi1II='';$[Ii1II11l(0x386,'o68D')]=process[Ii1II11l(0x54f,'[nd)')][Ii1II11l(0x26e,'eyiu')]||Ii1il1iI,$[Ii1II11l(0x57f,'Q2^y')]=process[Ii1II11l(0x615,'8bVr')][Ii1II11l(0x643,'5A%1')]||lIiIi1II,ill1iiil(),liIlIli1(),$[Ii1II11l(0x2d4,'wKuG')]=[],!(async()=>{const iililIii=Ii1II11l,ll1lllil={'uRpDB':function(IlI1l1i,ii1iii){return IlI1l1i+ii1iii;},'lriuH':iililIii(0x331,'u%BJ'),'tzNSN':function(iI1I1i1,i1I1I111){return iI1I1i1!==i1I1I111;},'MobBH':iililIii(0x674,'$EQH'),'nNIqX':'Gmwlk','KkTCD':iililIii(0x1f7,'E7aF'),'kIBse':'https://bean.m.jd.com/','wxJYh':function(i1i1lI,iliiIi){return i1i1lI(iliiIi);},'qGvDK':iililIii(0x71d,'XR1l'),'KRiII':function(il1il1il,IIi1i1I1){return il1il1il!==IIi1i1I1;},'gHjGE':iililIii(0x4db,'r&!a'),'VjA
|
|||
|
// 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"])
|