mirror of https://github.com/KingRan/KR.git
25 lines
121 KiB
JavaScript
25 lines
121 KiB
JavaScript
|
/*
|
|||
|
11.10-11.18 钜惠云集 好礼相送
|
|||
|
开卡脚本,一次性脚本
|
|||
|
|
|||
|
//export jd_opencard_blacklist="" // 黑名单 用&隔开 pin值
|
|||
|
//export JD_LZ_OPENCARD="false" //关闭开卡相关活动运行
|
|||
|
//export opencard_draw="3" //抽奖次数 3
|
|||
|
————————————————
|
|||
|
入口:[ 11.10-11.18 钜惠云集 好礼相送 ]
|
|||
|
|
|||
|
请求太频繁会被黑ip
|
|||
|
请更换IP后再执行脚本
|
|||
|
cron:1 1 1 1 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#11.10-11.18 钜惠云集 好礼相送
|
|||
|
1 1 1 1 * jd_opencardL348.js, tag=11.10-11.18 钜惠云集 好礼相送, enabled=true
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('11.10-11.18 钜惠云集 好礼相送')
|
|||
|
var version_='jsjiami.com.v7';const iiIliI=iii1II;(function(lII1il,Il1Iii,Ii1iI,Il1Iil,ilI,iIIlI,i1li1l){return lII1il=lII1il>>0x2,iIIlI='hs',i1li1l='hs',function(l11I1,iiIli1,il11i1,iII1i1,l11II){const iiiIl=iii1II;iII1i1='tfi',iIIlI=iII1i1+iIIlI,l11II='up',i1li1l+=l11II,iIIlI=il11i1(iIIlI),i1li1l=il11i1(i1li1l),il11i1=0x0;const ili=l11I1();while(!![]&&--Il1Iil+iiIli1){try{iII1i1=parseInt(iiiIl(0x400,'qF1K'))/0x1+-parseInt(iiiIl(0x278,'FjR1'))/0x2*(-parseInt(iiiIl(0x485,'mt%J'))/0x3)+parseInt(iiiIl(0x3a5,'Xdn9'))/0x4*(-parseInt(iiiIl(0x4c7,'k]PY'))/0x5)+parseInt(iiiIl(0x4d0,'cK&$'))/0x6*(-parseInt(iiiIl(0x51d,'OVIA'))/0x7)+-parseInt(iiiIl(0x70b,'AWYK'))/0x8+-parseInt(iiiIl(0x218,'%9e1'))/0x9*(-parseInt(iiiIl(0x43e,'Atmj'))/0xa)+parseInt(iiiIl(0x40b,'2LgS'))/0xb;}catch(iIIl1){iII1i1=il11i1;}finally{l11II=ili[iIIlI]();if(lII1il<=Il1Iil)il11i1?ilI?iII1i1=l11II:ilI=l11II:il11i1=l11II;else{if(il11i1==ilI['replace'](/[KSTgyEJPWXbukVdInQGlU=]/g,'')){if(iII1i1===iiIli1){ili['un'+iIIlI](l11II);break;}ili[i1li1l](l11II);}}}}}(Ii1iI,Il1Iii,function(ill,lIli,ilii1I,Ii1i1,lIll,iiiIi,ilii11){return lIli='\x73\x70\x6c\x69\x74',ill=arguments[0x0],ill=ill[lIli](''),ilii1I=`\x72\x65\x76\x65\x72\x73\x65`,ill=ill[ilii1I]('\x76'),Ii1i1=`\x6a\x6f\x69\x6e`,(0x146c96,ill[Ii1i1](''));});}(0x328,0x6062c,Iii11l,0xcc),Iii11l)&&(version_=iiIliI(0x527,'tOZ4'));const l1Iiil=$['isNode']()?require(iiIliI(0x47b,'k]PY')):'',I1li1I=$[iiIliI(0x2b8,'OM*Z')]()?require('./sendNotify'):'';let IIiII=$[iiIliI(0x36f,'!aQE')]()?process[iiIliI(0x6d6,'h*ir')]['opencard_draw']?process[iiIliI(0x6ea,'])MZ')][iiIliI(0x74d,'tT&%')]:'0':$['getdata'](iiIliI(0x6fb,'Atmj'))?$[iiIliI(0x2bf,'g[0y')](iiIliI(0x40e,'KqK5')):'0',iiiI=$['isNode']()?process[iiIliI(0x327,'0PL0')][iiIliI(0x665,'KMuE')]?process[iiIliI(0x4c1,'mt%J')][iiIliI(0x4d4,'HNls')]:![]:$[iiIliI(0x216,'%9e1')](iiIliI(0x2eb,'0PL0'))?$['getdata'](iiIliI(0x1b8,'qn67')):![];const I1li11=process[iiIliI(0x5a1,'!*4E')][iiIliI(0x287,'%9e1')]===iiIliI(0x1a2,'0PL0'),II1iIl=require(iiIliI(0x5d9,'vJV)')),II1iIi=require('./function/krh5st'),iI1iI=require(iiIliI(0x6d4,'HNls')),Ii11I1=require(iiIliI(0x253,'g[0y'));let li1IiI=iiIliI(0x47d,'vJV)'),Illl=[],Illi='',l1IiiI={};if($[iiIliI(0x39e,'!*4E')]()){Object['keys'](l1Iiil)['forEach'](iil1=>{const liIiIl=iiIliI;Illl[liIiIl(0x354,'$H3S')](l1Iiil[iil1]);});if(process[iiIliI(0x33e,'cK&$')][iiIliI(0x593,'$G1T')]&&process['env']['JD_DEBUG']===iiIliI(0x4e9,'qn67'))console[iiIliI(0x330,'])MZ')]=()=>{};}else Illl=[$['getdata']('CookieJD'),$['getdata'](iiIliI(0x497,'l[ZY')),...l1IilI($['getdata']('CookiesJD')||'[]')['map'](iiIIiI=>iiIIiI['cookie'])]['filter'](i1liII=>!!i1liII);allMessage='',message='',$[iiIliI(0x600,'OM*Z')]=![],$[iiIliI(0x609,'fc[v')]=![],$['activityEnd']=![];let II1iI1='',iI1i1='',il11Il=process[iiIliI(0x29b,'^31b')][iiIliI(0x2f4,'g[0y')]?process[iiIliI(0x729,'$H3S')]['JD_LZ_OPENCARD']:iiIliI(0x72b,'%9e1'),IIiI1='',II1iII='';$[iiIliI(0x708,'HNls')]=process[iiIliI(0x606,'tT&%')][iiIliI(0x69e,'tOZ4')]||IIiI1,$['blacklist']=process[iiIliI(0x5a0,'3f@6')][iiIliI(0x6cc,'Z^vk')]||II1iII,i1ii1I(),IIilI1(),$['errMsgPin']=[],!(async()=>{const lII11=iiIliI,ilII1i={'BDXWI':function(ill1I,ilII1l){return ill1I===ilII1l;},'OYXlz':function(IIilII,l1Iil1){return IIilII===l1Iil1;},'SDyhE':lII11(0x477,'HNls'),'XFeuL':function(IIiIl,iiiiI1){return IIiIl!==iiiiI1;},'WIDNY':lII11(0x4f2,'^31b'),'EaLHF':lII11(0x4eb,'$G1T'),'Mfkac':'【提示】请先获取cookie\x0a直接使用NobyDa的京东签到获取','SntEy':lII11(0x55f,'cK&$'),'QzeFs':'http://code.kingran.cf/348.json','DqBRn':lII11(0x630,'&F#g'),'cUhyz':function(IIiIi,i1ii1i,iiii){return IIiIi(i1ii1i,iiii);},'pAXMF':lII11(0x3f4,'fc[v'),'YwwjB':function(iiil,li1Iil,ill11){return iiil(li1Iil,ill11);},'tvamh':lII11(0x754,'l[ZY'),'GKDjN':'❖\x20活动入口:\x0ahttps://lzdz1-isv.isvjcloud.com/dingzhi/joinCommon/activity/activity?activityId=','PAldJ':'❖\x20默认不加购,如需加购请设置环境变量\x20[opencard_addCart],变量值为\x20true','oESIm':'❖\x20默认不抽奖,如需抽奖请设置环境变量\x20[opencard_draw]<EFBFBD>
|
|||
|
// 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"])
|