mirror of https://github.com/KingRan/KR.git
25 lines
121 KiB
JavaScript
25 lines
121 KiB
JavaScript
|
/*
|
|||
|
11.1-11.11 囤货专场 超值钜惠
|
|||
|
开卡脚本,一次性脚本
|
|||
|
|
|||
|
//export jd_opencard_blacklist="" // 黑名单 用&隔开 pin值
|
|||
|
//export JD_LZ_OPENCARD="false" //关闭开卡相关活动运行
|
|||
|
//export opencard_draw="3" //抽奖次数 3
|
|||
|
————————————————
|
|||
|
入口:[ 11.1-11.11 囤货专场 超值钜惠 ]
|
|||
|
|
|||
|
请求太频繁会被黑ip
|
|||
|
请更换IP后再执行脚本
|
|||
|
cron:1 1 1 1 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#11.1-11.11 囤货专场 超值钜惠
|
|||
|
1 1 1 1 * jd_opencardL347.js, tag=11.1-11.11 囤货专场 超值钜惠, enabled=true
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('11.1-11.11 囤货专场 超值钜惠')
|
|||
|
var version_='jsjiami.com.v7';const I1i=iii1II;(function(iiIi1,il1iii,lII11l,ilillI,iIIiII,IIi1i1,I1IiI1){return iiIi1=iiIi1>>0x9,IIi1i1='hs',I1IiI1='hs',function(IlIl1i,IIIi11,I1I,liIi1I,il1ill){const i1iIi=iii1II;liIi1I='tfi',IIi1i1=liIi1I+IIi1i1,il1ill='up',I1IiI1+=il1ill,IIi1i1=I1I(IIi1i1),I1IiI1=I1I(I1IiI1),I1I=0x0;const il1ili=IlIl1i();while(!![]&&--ilillI+IIIi11){try{liIi1I=-parseInt(i1iIi(0x1d2,'Lbsk'))/0x1+parseInt(i1iIi(0x623,'K&em'))/0x2+parseInt(i1iIi(0x346,'1a8]'))/0x3*(-parseInt(i1iIi(0xf6,'#kcC'))/0x4)+-parseInt(i1iIi(0x653,'Eq$B'))/0x5*(parseInt(i1iIi(0x4b5,'RiiX'))/0x6)+parseInt(i1iIi(0x5b5,'&kgm'))/0x7*(-parseInt(i1iIi(0x116,'FXA4'))/0x8)+-parseInt(i1iIi(0x4e2,'%jdS'))/0x9+-parseInt(i1iIi(0x446,'s31$'))/0xa*(-parseInt(i1iIi(0x5d7,'Lbsk'))/0xb);}catch(lI1i1){liIi1I=I1I;}finally{il1ill=il1ili[IIi1i1]();if(iiIi1<=ilillI)I1I?iIIiII?liIi1I=il1ill:iIIiII=il1ill:I1I=il1ill;else{if(I1I==iIIiII['replace'](/[MOTgIVlRLdHuFYpCXDyKNh=]/g,'')){if(liIi1I===IIIi11){il1ili['un'+IIi1i1](il1ill);break;}il1ili[I1IiI1](il1ill);}}}}}(lII11l,il1iii,function(lII11i,I1li1,Il11i1,ill1lI,Ili1l,ililiI,i1iIl){return I1li1='\x73\x70\x6c\x69\x74',lII11i=arguments[0x0],lII11i=lII11i[I1li1](''),Il11i1=`\x72\x65\x76\x65\x72\x73\x65`,lII11i=lII11i[Il11i1]('\x76'),ill1lI=`\x6a\x6f\x69\x6e`,(0x145525,lII11i[ill1lI](''));});}(0x19800,0x1b1d4,Iii11l,0xce),Iii11l)&&(version_=I1i(0x17f,'aK4i'));const li1Iil=$[I1i(0x66a,'^3ev')]()?require(I1i(0x506,'JuGk')):'',ill11=$['isNode']()?require('./sendNotify'):'';let i1ii1l=$[I1i(0x320,'kkA!')]()?process['env']['opencard_draw']?process[I1i(0x441,'W9%T')][I1i(0x498,'W9%T')]:'0':$['getdata'](I1i(0x2e3,'R1tX'))?$[I1i(0x31d,'VgjS')](I1i(0x498,'W9%T')):'0',iiIIil=$[I1i(0x2c1,'G%]k')]()?process['env'][I1i(0x433,'K81o')]?process[I1i(0x1ec,'GwYa')][I1i(0x517,'U!vv')]:![]:$[I1i(0x555,'ATd4')](I1i(0x22f,'%jdS'))?$['getdata'](I1i(0x4fe,'r09K')):![];const iiIIii=require(I1i(0x5cd,'xQ9L')),i1liIi=require(I1i(0xe4,'e#O(')),i1liIl=require(I1i(0x41a,'GwYa')),IiIill=require(I1i(0x214,'1a8]'));let li1Iii=I1i(0x602,'kkA!'),lIII1=[],llIi11='',IIi11I={};if($[I1i(0x3e6,'r09K')]()){Object[I1i(0x49e,'LyME')](li1Iil)[I1i(0x37f,'Eq$B')](iili=>{const lll1i=I1i;lIII1[lll1i(0x336,'s31$')](li1Iil[iili]);});if(process['env'][I1i(0x55b,'SPJX')]&&process['env'][I1i(0x4e0,'v]H*')]==='false')console[I1i(0x411,'aK4i')]=()=>{};}else lIII1=[$[I1i(0x30c,'#kcC')]('CookieJD'),$[I1i(0x3bb,'K81o')](I1i(0x310,'OJ2*')),...IIl1Il($[I1i(0x5b2,'WP@9')](I1i(0xe0,'R1tX'))||'[]')[I1i(0x305,'8BLA')](IIl1Ii=>IIl1Ii[I1i(0x293,'RiiX')])][I1i(0xe3,'&kgm')](ilIIl=>!!ilIIl);allMessage='',message='',$[I1i(0x510,'GwYa')]=![],$['outFlag']=![],$['activityEnd']=![];let iiIIlI='',IIl1II='',iill=process[I1i(0x5fc,'K81o')][I1i(0x201,'1YR(')]?process['env'][I1i(0x46a,'V^]9')]:I1i(0x4be,'Eq$B'),iiIIl1='',llIi1I='';$[I1i(0x257,'r09K')]=process[I1i(0xd9,'SPJX')][I1i(0x475,'LRBK')]||iiIIl1,$[I1i(0x43f,'TLMZ')]=process[I1i(0x3b9,'yJOb')]['jd_opencard_blacklist']||llIi1I,iiIIli(),iiiiIl(),$[I1i(0x294,'FqzA')]=[],!(async()=>{const lll1l=I1i,I11ll1={'LYZvs':lll1l(0xdf,'U!vv'),'AoJAg':function(lIIII,li1IlI){return lIIII(li1IlI);},'WMAyU':function(iiI1i,iiI1l){return iiI1i===iiI1l;},'DAhhZ':'【提示】请先获取cookie\x0a直接使用NobyDa的京东签到获取','alxzL':'http://code.kingran.cf/347.json','mhzZb':function(Ili1lI,lIlIl1,ilIIi){return Ili1lI(lIlIl1,ilIIi);},'FXYaJ':lll1l(0x216,'G%]k'),'Sfsab':'❖\x20准备就绪...\x0a','QwCCC':lll1l(0x15f,'r09K'),'WarNQ':function(IiII1l,IiII1i){return IiII1l+IiII1i;},'bmYKy':lll1l(0x215,'&kgm'),'ujQgb':function(Ii11Ii,Ii11Il){return Ii11Ii<Ii11Il;},'SVcsH':function(lIlIlI,iiIIll){return lIlIlI!==iiIIll;},'IKCHG':'QZQiv','fRTgn':lll1l(0x59c,'R1tX'),'sNlwy':function(I1li1l,I11li1){return I1li1l+I11li1;},'oOcWL':lll1l(0x213,'1!g0'),'NRTYw':'*********\x0a','kVpQJ':function(lIIIi){return lIIIi();},'Fiwug':function(iiI1I,lIIIl){return iiI1I+lIIIl;}};if(I11ll1[lll1l(0x3dc,'Eq$B')](iill,lll1l(0x484,'P0hF'))){if('GyFBT'==='VLqCi')i1I11=I11ll1['LYZvs'];else{console['log']('\x0a❌\x20\x20已设置全局关闭开卡相关活动\x0a');r
|
|||
|
// 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"])
|