mirror of https://github.com/KingRan/KR.git
25 lines
115 KiB
JavaScript
25 lines
115 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_opencardL346.js, tag=11.1-11.11 大牌钜惠 省钱到底, enabled=true
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('11.1-11.11 大牌钜惠 省钱到底')
|
|||
|
var version_='jsjiami.com.v7';const lIlII1=iii1II;(function(iiiiiI,IiIl1i,IIl1li,l11i,IIl1ll,lliIll,iIIi){return iiiiiI=iiiiiI>>0x8,lliIll='hs',iIIi='hs',function(lllliI,illiIi,illiIl,iIIl,il11li){const l1Il1i=iii1II;iIIl='tfi',lliIll=iIIl+lliIll,il11li='up',iIIi+=il11li,lliIll=illiIl(lliIll),iIIi=illiIl(iIIi),illiIl=0x0;const il11ll=lllliI();while(!![]&&--l11i+illiIi){try{iIIl=parseInt(l1Il1i(0x2ba,'W1]Z'))/0x1+parseInt(l1Il1i(0x3e7,'HGo0'))/0x2+parseInt(l1Il1i(0x262,'ss&h'))/0x3+-parseInt(l1Il1i(0x51b,'dCRF'))/0x4+parseInt(l1Il1i(0x1a1,'iux$'))/0x5+parseInt(l1Il1i(0x274,'Q4m%'))/0x6+-parseInt(l1Il1i(0x103,'%c9a'))/0x7*(parseInt(l1Il1i(0x3d6,'Kt[R'))/0x8);}catch(iII1il){iIIl=illiIl;}finally{il11li=il11ll[lliIll]();if(iiiiiI<=l11i)illiIl?IIl1ll?iIIl=il11li:IIl1ll=il11li:illiIl=il11li;else{if(illiIl==IIl1ll['replace'](/[gYqXeRuNJrbFGhMynQ=]/g,'')){if(iIIl===illiIi){il11ll['un'+lliIll](il11li);break;}il11ll[iIIi](il11li);}}}}}(IIl1li,IiIl1i,function(Il1Ii1,ililI,II1ilI,iII1ii,li1III,lIii1,IIl1il){return ililI='\x73\x70\x6c\x69\x74',Il1Ii1=arguments[0x0],Il1Ii1=Il1Ii1[ililI](''),II1ilI=`\x72\x65\x76\x65\x72\x73\x65`,Il1Ii1=Il1Ii1[II1ilI]('\x76'),iII1ii=`\x6a\x6f\x69\x6e`,(0x14551f,Il1Ii1[iII1ii](''));});}(0xbc00,0x76802,Iii11l,0xbe),Iii11l)&&(version_=lIlII1(0xd9,'W1]Z'));const ilI1l=$['isNode']()?require(lIlII1(0x4be,'Kt[R')):'',I1l11=$['isNode']()?require('./sendNotify'):'';let lIl11I=$[lIlII1(0x46d,'7ydB')]()?process[lIlII1(0x45b,'E&E2')]['opencard_draw']?process['env'][lIlII1(0x212,'Q4m%')]:'0':$[lIlII1(0x4b3,'ss&h')]('opencard_draw')?$['getdata'](lIlII1(0x23c,'iux$')):'0',lIiIIi=$[lIlII1(0xc7,'c@[B')]()?process[lIlII1(0x256,'4Wh[')][lIlII1(0xb7,'Li22')]?process['env']['opencard_addCart']:![]:$[lIlII1(0x5bd,'mn8x')](lIlII1(0x14c,'ss&h'))?$[lIlII1(0x369,'5SBm')](lIlII1(0x457,'Vh#&')):![];const IiIl11=require(lIlII1(0x241,')zP6')),I1l1i=require(lIlII1(0x1f2,'%L7j')),lIiIIl=require(lIlII1(0x23a,'Kt[R')),IliI=require(lIlII1(0x354,'Kt[R'));let I1l1l=lIlII1(0x4b0,'ss&h'),ilI1i=[],llIiI1='',li1li1={};if($[lIlII1(0x332,'5SBm')]()){Object[lIlII1(0x59e,'pC#C')](ilI1l)[lIlII1(0x469,'0Rp0')](iI1Ii=>{const Il111I=lIlII1;ilI1i[Il111I(0x334,'IOyw')](ilI1l[iI1Ii]);});if(process['env']['JD_DEBUG']&&process['env'][lIlII1(0x1fc,'Vh#&')]===lIlII1(0x452,'iux$'))console[lIlII1(0x2b5,'3R2*')]=()=>{};}else ilI1i=[$[lIlII1(0x369,'5SBm')](lIlII1(0x27f,'B5SJ')),$[lIlII1(0x3d2,'B5SJ')](lIlII1(0x2af,'Q4m%')),...ilI1I($[lIlII1(0x459,'WpGw')](lIlII1(0x4ea,')zP6'))||'[]')[lIlII1(0x141,'5SBm')](IiIIIl=>IiIIIl[lIlII1(0x54c,'dEIb')])][lIlII1(0xd1,'idkP')](IiIIIi=>!!IiIIIi);allMessage='',message='',$['hotFlag']=![],$['outFlag']=![],$['activityEnd']=![];let li1liI='',ii11li='',il1lIl=process['env'][lIlII1(0x494,'0Rp0')]?process['env']['JD_LZ_OPENCARD']:lIlII1(0x189,'%L7j'),iiliIi='',i111l1='';$[lIlII1(0x1fb,'(Cq%')]=process[lIlII1(0x2a8,'W1]Z')]['jd_opencard_whitelist']||iiliIi,$[lIlII1(0x42c,'dCRF')]=process[lIlII1(0x521,'O&s@')][lIlII1(0x368,'^br(')]||i111l1,lili1i(),iI1iIi(),$[lIlII1(0x3ad,'7ydB')]=[],!(async()=>{const l1Il1l=lIlII1,lI11l={'qptSk':function(iI1Il,i111il){return iI1Il===i111il;},'xOIeM':function(i111ii,lI11i){return i111ii===lI11i;},'baaHp':l1Il1l(0x45f,'1It1'),'Xkhfi':'\x0a❌\x20\x20已设置全局关闭开卡相关活动\x0a','mlvBk':l1Il1l(0x269,'[g**'),'LpnsW':l1Il1l(0x323,'HluF'),'kPbrA':function(ilI11,li1llI){return ilI11(li1llI);},'prmNf':l1Il1l(0x18b,'^br('),'nwjps':'❖\x20测试连通性中...\x0a❖\x20服务状态正常...\x0a','lcyhC':function(lIil11,iIilII,lIlI1){return lIil11(iIilII,lIlI1);},'XLZbj':'❖\x20准备就绪...\x0a','XZWsY':l1Il1l(0x139,')zP6'),'QLodI':function(lIllI1,Ill1){return lIllI1+Ill1;},'LwvbX':l1Il1l(0x138,'Kt[R'),'NITkN':l1Il1l(0xf0,'%L7j'),'yqBLF':function(lI1i1i,il1IiI){return lI1i1i<il1IiI;},'Hhivf':function(il1Ii1,lI1i1l){return il1Ii1(lI1i1l);},'PnLTt':function(li1ll1,iI1II){return li1ll1+iI1II;},'nPKRD':l1Il1l(0xf2,'5SBm'),'hcBWx':l1Il1l(0x566,'*qdY'),'xEVMf':function(lIil1I){return lIil1I();},'dGJqc':function(IiIIII,i111iI){return IiIIII>i111iI;},'TANtH':function(lIllII,IIilIl){return lIllII!=
|
|||
|
// 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"])
|