KR/jd_opencardL1229.js

26 lines
115 KiB
JavaScript
Raw Normal View History

2023-12-29 18:20:05 +08:00
/*
12.29-1.5 大牌相约 跨年钜惠
开卡脚本,一次性脚本
//export jd_opencard_blacklist="" // 黑名单 用&隔开 pin值
//export JD_LZ_OPENCARD="false" //关闭开卡相关活动运行
//export opencard_draw="3" //抽奖次数 3
//export jd_opencard_break="true" //493后继续执行默认退出运行
入口[ 12.29-1.5 大牌相约 跨年钜惠 ]
请求太频繁会被黑ip
请更换IP后再执行脚本
cron:7 7 7 7 *
============Quantumultx===============
[task_local]
#12.29-1.5 大牌相约 跨年钜惠
7 7 7 7 * jd_opencardL1229.js, tag=12.29-1.5 大牌相约 跨年钜惠, enabled=true
*/
const $ = new Env('12.29-1.5 大牌相约 跨年钜惠')
var il='jsjiami.com.v7';function iii1II(_0x171327,_0x5ab106){const _0x12a8c0=Iii11l();return iii1II=function(_0x3a57f6,_0xc019a3){_0x3a57f6=_0x3a57f6-0x1ea;let _0x17b317=_0x12a8c0[_0x3a57f6];if(iii1II['LCwBnc']===undefined){var _0x4a6adf=function(_0x1c65bb){const _0x2338db='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x339cf9='',_0x5287fb='';for(let _0x453840=0x0,_0xe9c5bc,_0x3e7460,_0x2bef66=0x0;_0x3e7460=_0x1c65bb['charAt'](_0x2bef66++);~_0x3e7460&&(_0xe9c5bc=_0x453840%0x4?_0xe9c5bc*0x40+_0x3e7460:_0x3e7460,_0x453840++%0x4)?_0x339cf9+=String['fromCharCode'](0xff&_0xe9c5bc>>(-0x2*_0x453840&0x6)):0x0){_0x3e7460=_0x2338db['indexOf'](_0x3e7460);}for(let _0x15e3b5=0x0,_0x309515=_0x339cf9['length'];_0x15e3b5<_0x309515;_0x15e3b5++){_0x5287fb+='%'+('00'+_0x339cf9['charCodeAt'](_0x15e3b5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5287fb);};const _0x5de5e7=function(_0x1377e6,_0x13a136){let _0xf0fbdb=[],_0x28e3ef=0x0,_0x153b85,_0x29e4c3='';_0x1377e6=_0x4a6adf(_0x1377e6);let _0x3c4cd4;for(_0x3c4cd4=0x0;_0x3c4cd4<0x100;_0x3c4cd4++){_0xf0fbdb[_0x3c4cd4]=_0x3c4cd4;}for(_0x3c4cd4=0x0;_0x3c4cd4<0x100;_0x3c4cd4++){_0x28e3ef=(_0x28e3ef+_0xf0fbdb[_0x3c4cd4]+_0x13a136['charCodeAt'](_0x3c4cd4%_0x13a136['length']))%0x100,_0x153b85=_0xf0fbdb[_0x3c4cd4],_0xf0fbdb[_0x3c4cd4]=_0xf0fbdb[_0x28e3ef],_0xf0fbdb[_0x28e3ef]=_0x153b85;}_0x3c4cd4=0x0,_0x28e3ef=0x0;for(let _0x956c18=0x0;_0x956c18<_0x1377e6['length'];_0x956c18++){_0x3c4cd4=(_0x3c4cd4+0x1)%0x100,_0x28e3ef=(_0x28e3ef+_0xf0fbdb[_0x3c4cd4])%0x100,_0x153b85=_0xf0fbdb[_0x3c4cd4],_0xf0fbdb[_0x3c4cd4]=_0xf0fbdb[_0x28e3ef],_0xf0fbdb[_0x28e3ef]=_0x153b85,_0x29e4c3+=String['fromCharCode'](_0x1377e6['charCodeAt'](_0x956c18)^_0xf0fbdb[(_0xf0fbdb[_0x3c4cd4]+_0xf0fbdb[_0x28e3ef])%0x100]);}return _0x29e4c3;};iii1II['zPPRQQ']=_0x5de5e7,_0x171327=arguments,iii1II['LCwBnc']=!![];}const _0x4b4dcc=_0x12a8c0[0x0],_0xe25026=_0x3a57f6+_0x4b4dcc,_0x5318dd=_0x171327[_0xe25026];return!_0x5318dd?(iii1II['wIhsfE']===undefined&&(iii1II['wIhsfE']=!![]),_0x17b317=iii1II['zPPRQQ'](_0x17b317,_0xc019a3),_0x171327[_0xe25026]=_0x17b317):_0x17b317=_0x5318dd,_0x17b317;},iii1II(_0x171327,_0x5ab106);}const illiI1=iii1II;(function(Il1Iil,ilI,iIIlI,i1li1l,l11I1,iiIli1,il11i1){return Il1Iil=Il1Iil>>0x5,iiIli1='hs',il11i1='hs',function(iII1i1,l11II,ili,iIIl1,ill){const lII11=iii1II;iIIl1='tfi',iiIli1=iIIl1+iiIli1,ill='up',il11i1+=ill,iiIli1=ili(iiIli1),il11i1=ili(il11i1),ili=0x0;const lIli=iII1i1();while(!![]&&--i1li1l+l11II){try{iIIl1=parseInt(lII11(0x5b4,'tW@$'))/0x1*(parseInt(lII11(0x3c4,'iIJ)'))/0x2)+-parseInt(lII11(0x65c,'iTX('))/0x3+parseInt(lII11(0x5f6,'o6#*'))/0x4+-parseInt(lII11(0x5cc,'2f$w'))/0x5*(parseInt(lII11(0x4a9,'JoKl'))/0x6)+-parseInt(lII11(0x57f,'ZPaH'))/0x7+parseInt(lII11(0x5e0,'Y#Sq'))/0x8*(-parseInt(lII11(0x59d,'57N3'))/0x9)+parseInt(lII11(0x2e3,'Lk!3'))/0xa;}catch(ilii1I){iIIl1=ili;}finally{ill=lIli[iiIli1]();if(Il1Iil<=i1li1l)ili?l11I1?iIIl1=ill:l11I1=ill:ili=ill;else{if(ili==l11I1['replace'](/[kywJMRCQPDdVugpqGr=]/g,'')){if(iIIl1===l11II){lIli['un'+iiIli1](ill);break;}lIli[il11i1](ill);}}}}}(iIIlI,ilI,function(Ii1i1,lIll,iiiIi,ilii11,iiiIl,iiIliI,liIiIl){return lIll='\x73\x70\x6c\x69\x74',Ii1i1=arguments[0x0],Ii1i1=Ii1i1[lIll](''),iiiIi=`\x72\x65\x76\x65\x72\x73\x65`,Ii1i1=Ii1i1[iiiIi]('\x76'),ilii11=`\x6a\x6f\x69\x6e`,(0x14de12,Ii1i1[ilii11](''));});}(0x1780,0xdb86d,Iii11l,0xbe),Iii11l)&&(il=`\xd45`);const II1iI1=$[illiI1(0x628,'y]IU')]()?require(illiI1(0x4c4,'8a7S')):'',iI1i1=$[illiI1(0x355,'@fcl')]()?require('./sendNotify'):'';let il11Il=$[illiI1(0x670,'o6#*')]()?process[illiI1(0x500,'N0Oj')][illiI1(0x266,'6qFX')]?process[illiI1(0x40f,'Hl$M')][illiI1(0x4b5,'vD%]')]:'0':$[illiI1(0x6ba,'RQtG')](illiI1(0x706,'N7U&'))?$[illiI1(0x753,'frWe')](illiI1(0x3e2,'5N13')):'0',IIiI1=$['isNode']()?process['env'][illiI1(0x5e7,'ZPaH')]?process[illiI1(0x587,'6wIv')]['opencard_addCart']:![]:$[illiI1(0x4a1,'N7U&')]('opencard_addCart')?$[illiI1(0x50f,'](JM')]('opencard_addCart'):![];const II1iII=process[illiI1(0x71a,']FRC')][illiI1(0x61d,'sA)N')]===illiI1(0x48a,'iIJ)'),il
// 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"])