KR/jd_opencardL333.js

25 lines
116 KiB
JavaScript
Raw Normal View History

2023-09-12 00:10:24 +08:00
/*
9.12-9.18 秋妆美礼 好物惊喜
开卡脚本,一次性脚本
//export jd_opencard_blacklist="" // 黑名单 用&隔开 pin值
//export JD_LZ_OPENCARD="false" //关闭开卡相关活动运行
//export opencard_draw="3" //抽奖次数 3
入口[ 9.12-9.18 秋妆美礼 好物惊喜 ]
请求太频繁会被黑ip
请更换IP后再执行脚本
cron:11 11 11 11 *
============Quantumultx===============
[task_local]
#9.12-9.18 秋妆美礼 好物惊喜
11 11 11 11 * jd_opencardL333.js, tag=9.12-9.18 秋妆美礼 好物惊喜, enabled=true
*/
const $ = new Env('9.12-9.18 秋妆美礼 好物惊喜')
var version_='jsjiami.com.v7';const IIlli11I=I11iI1;(function(Ii11IIIi,lI1il1iI,Iiiii1i,I111ili,l1lIlI1,lll1iIi1,I1111i1l){return Ii11IIIi=Ii11IIIi>>0x4,lll1iIi1='hs',I1111i1l='hs',function(iI11I1ii,I1llll1l,Il1lIi11,l1iIillI,l1lIili1){const IilllI1i=I11iI1;l1iIillI='tfi',lll1iIi1=l1iIillI+lll1iIi1,l1lIili1='up',I1111i1l+=l1lIili1,lll1iIi1=Il1lIi11(lll1iIi1),I1111i1l=Il1lIi11(I1111i1l),Il1lIi11=0x0;const lIIllIll=iI11I1ii();while(!![]&&--I111ili+I1llll1l){try{l1iIillI=parseInt(IilllI1i(0x4f0,'n45x'))/0x1*(parseInt(IilllI1i(0x305,'n45x'))/0x2)+parseInt(IilllI1i(0x5c8,'0J6M'))/0x3+parseInt(IilllI1i(0x19e,'MMX]'))/0x4*(parseInt(IilllI1i(0x2c1,'qPGY'))/0x5)+parseInt(IilllI1i(0x18c,'9aH7'))/0x6*(-parseInt(IilllI1i(0x4fb,'qPGY'))/0x7)+-parseInt(IilllI1i(0x18b,'s@*H'))/0x8+parseInt(IilllI1i(0x5f4,'BAgX'))/0x9*(-parseInt(IilllI1i(0x625,'9%*k'))/0xa)+parseInt(IilllI1i(0x19f,'OB%u'))/0xb;}catch(lI1iiiI){l1iIillI=Il1lIi11;}finally{l1lIili1=lIIllIll[lll1iIi1]();if(Ii11IIIi<=I111ili)Il1lIi11?l1lIlI1?l1iIillI=l1lIili1:l1lIlI1=l1lIili1:Il1lIi11=l1lIili1;else{if(Il1lIi11==l1lIlI1['replace'](/[KpYGNQWdkXqyRLCufDh=]/g,'')){if(l1iIillI===I1llll1l){lIIllIll['un'+lll1iIi1](l1lIili1);break;}lIIllIll[I1111i1l](l1lIili1);}}}}}(Iiiii1i,lI1il1iI,function(l1I1I1I,IIIIlIi,l1ii11ll,IlIl1l1l,iillIili,IIIIiIlI,l1llllI){return IIIIlIi='\x73\x70\x6c\x69\x74',l1I1I1I=arguments[0x0],l1I1I1I=l1I1I1I[IIIIlIi](''),l1ii11ll=`\x72\x65\x76\x65\x72\x73\x65`,l1I1I1I=l1I1I1I[l1ii11ll]('\x76'),IlIl1l1l=`\x6a\x6f\x69\x6e`,(0x13dcee,l1I1I1I[IlIl1l1l](''));});}(0xc80,0x403f8,l1lI1l1l,0xca),l1lI1l1l)&&(version_=l1lI1l1l);function I11iI1(_0x2e9a4c,_0x4a6edd){const _0x333369=l1lI1l1l();return I11iI1=function(_0x1d1803,_0x419e4b){_0x1d1803=_0x1d1803-0x16d;let _0x3670dc=_0x333369[_0x1d1803];if(I11iI1['aMtYhf']===undefined){var _0x41a01a=function(_0x26ac1f){const _0x72ecb7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x57ee56='',_0x230aa8='';for(let _0x49d1f7=0x0,_0x466d34,_0x4163de,_0x4d9346=0x0;_0x4163de=_0x26ac1f['charAt'](_0x4d9346++);~_0x4163de&&(_0x466d34=_0x49d1f7%0x4?_0x466d34*0x40+_0x4163de:_0x4163de,_0x49d1f7++%0x4)?_0x57ee56+=String['fromCharCode'](0xff&_0x466d34>>(-0x2*_0x49d1f7&0x6)):0x0){_0x4163de=_0x72ecb7['indexOf'](_0x4163de);}for(let _0x3e577b=0x0,_0x301bd9=_0x57ee56['length'];_0x3e577b<_0x301bd9;_0x3e577b++){_0x230aa8+='%'+('00'+_0x57ee56['charCodeAt'](_0x3e577b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x230aa8);};const _0x1d622b=function(_0x38cb51,_0x533097){let _0x403696=[],_0x4bbca1=0x0,_0x32f9a8,_0x367c2b='';_0x38cb51=_0x41a01a(_0x38cb51);let _0x5edda0;for(_0x5edda0=0x0;_0x5edda0<0x100;_0x5edda0++){_0x403696[_0x5edda0]=_0x5edda0;}for(_0x5edda0=0x0;_0x5edda0<0x100;_0x5edda0++){_0x4bbca1=(_0x4bbca1+_0x403696[_0x5edda0]+_0x533097['charCodeAt'](_0x5edda0%_0x533097['length']))%0x100,_0x32f9a8=_0x403696[_0x5edda0],_0x403696[_0x5edda0]=_0x403696[_0x4bbca1],_0x403696[_0x4bbca1]=_0x32f9a8;}_0x5edda0=0x0,_0x4bbca1=0x0;for(let _0x3f46dc=0x0;_0x3f46dc<_0x38cb51['length'];_0x3f46dc++){_0x5edda0=(_0x5edda0+0x1)%0x100,_0x4bbca1=(_0x4bbca1+_0x403696[_0x5edda0])%0x100,_0x32f9a8=_0x403696[_0x5edda0],_0x403696[_0x5edda0]=_0x403696[_0x4bbca1],_0x403696[_0x4bbca1]=_0x32f9a8,_0x367c2b+=String['fromCharCode'](_0x38cb51['charCodeAt'](_0x3f46dc)^_0x403696[(_0x403696[_0x5edda0]+_0x403696[_0x4bbca1])%0x100]);}return _0x367c2b;};I11iI1['ZamdlZ']=_0x1d622b,_0x2e9a4c=arguments,I11iI1['aMtYhf']=!![];}const _0x504008=_0x333369[0x0],_0x13ac39=_0x1d1803+_0x504008,_0x2f3564=_0x2e9a4c[_0x13ac39];return!_0x2f3564?(I11iI1['mMEJLq']===undefined&&(I11iI1['mMEJLq']=!![]),_0x3670dc=I11iI1['ZamdlZ'](_0x3670dc,_0x419e4b),_0x2e9a4c[_0x13ac39]=_0x3670dc):_0x3670dc=_0x2f3564,_0x3670dc;},I11iI1(_0x2e9a4c,_0x4a6edd);}const IIIlI1Ii=$['isNode']()?require(IIlli11I(0x3b1,'a7(!')):'',lIi11li1=$[IIlli11I(0x257,'Z^xy')]()?require('./sendNotify'):'';let IIiiIi1=$[IIlli11I(0x3a5,'A07W')]()?process['env'][IIlli11I(0x2e8,'aV!a')]?process[IIlli11I(0x35b,'kW)&')][IIlli11I(0x1d8,'n45x')]:'0':$['getdata']('opencard_draw')?$['getdata'](IIlli11I(0x287,'0J6M')):'0',
// 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"])