mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
21 lines
78 KiB
JavaScript
21 lines
78 KiB
JavaScript
|
/*
|
|||
|
活动名称:大牌联合(开卡)
|
|||
|
环境变量:
|
|||
|
jd_dplh_viewShop // 是否(true/false)做浏览任务,默认不做
|
|||
|
jd_dplh_addCart // 是否(true/false)做加购任务,默认不做
|
|||
|
jd_dplh_draw // 抽奖次数,变量暂时无效
|
|||
|
jd_dplh_blacklist // 黑名单 用&隔开 pin值
|
|||
|
jd_dplh_Notify // 是否通知(true/false),默认不通知
|
|||
|
jd_dplh_break // IP限制后继续执行(true/false)
|
|||
|
|
|||
|
实物奖品需要填写地址变量才行,具体请查看 WIki
|
|||
|
|
|||
|
cron "1 1 1 1 *" script-path=jd_dplh.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('大牌联合0810')
|
|||
|
var iil='jsjiami.com.v7';const ili1I=iii1II;if(function(i1lil,I1iIl,IilII,ili1l,i1lii,iilIII,liI1Il){return i1lil=i1lil>>0x6,iilIII='hs',liI1Il='hs',function(I1iIi,iiiI1I,lilI11,Ili1II,ili1i){const ilI11I=iii1II;Ili1II='tfi',iilIII=Ili1II+iilIII,ili1i='up',liI1Il+=ili1i,iilIII=lilI11(iilIII),liI1Il=lilI11(liI1Il),lilI11=0x0;const IiIi1=I1iIi();while(!![]&&--ili1l+iiiI1I){try{Ili1II=parseInt(ilI11I(0x42a,'teZ5'))/0x1+parseInt(ilI11I(0x2db,'3q7b'))/0x2+parseInt(ilI11I(0x1b8,'#7fg'))/0x3*(-parseInt(ilI11I(0x28a,'ZbY#'))/0x4)+-parseInt(ilI11I(0x486,'5iK*'))/0x5*(-parseInt(ilI11I(0x353,'bsQl'))/0x6)+-parseInt(ilI11I(0x232,'Sepp'))/0x7*(-parseInt(ilI11I(0x43e,'kEN&'))/0x8)+-parseInt(ilI11I(0x1c5,')Xnv'))/0x9+-parseInt(ilI11I(0x263,'2H#W'))/0xa*(parseInt(ilI11I(0x197,'Xd*0'))/0xb);}catch(l1Ii1){Ili1II=lilI11;}finally{ili1i=IiIi1[iilIII]();if(i1lil<=ili1l)lilI11?i1lii?Ili1II=ili1i:i1lii=ili1i:lilI11=ili1i;else{if(lilI11==i1lii['replace'](/[etKwdPVhpnFLxOCySE=]/g,'')){if(Ili1II===iiiI1I){IiIi1['un'+iilIII](ili1i);break;}IiIi1[liI1Il](ili1i);}}}}}(IilII,I1iIl,function(i1IilI,III1I1,ilI111,I1IllI,IIlI11,iIIll1,llIIII){return III1I1='\x73\x70\x6c\x69\x74',i1IilI=arguments[0x0],i1IilI=i1IilI[III1I1](''),ilI111=`\x72\x65\x76\x65\x72\x73\x65`,i1IilI=i1IilI[ilI111]('\x76'),I1IllI=`\x6a\x6f\x69\x6e`,(0x17d28b,i1IilI[I1IllI](''));});}(0x3040,0xc5ca3,Iii11l,0xc3),Iii11l){}function iii1II(_0x10554f,_0x1b2cc8){const _0x212e7a=Iii11l();return iii1II=function(_0x23f22c,_0x29763a){_0x23f22c=_0x23f22c-0xf5;let _0x1e4a5d=_0x212e7a[_0x23f22c];if(iii1II['EidUrK']===undefined){var _0x2fd7cf=function(_0x4f6e3e){const _0x3ff91d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x34b476='',_0x58c677='';for(let _0x101aff=0x0,_0x53495d,_0x1aca2d,_0x19585c=0x0;_0x1aca2d=_0x4f6e3e['charAt'](_0x19585c++);~_0x1aca2d&&(_0x53495d=_0x101aff%0x4?_0x53495d*0x40+_0x1aca2d:_0x1aca2d,_0x101aff++%0x4)?_0x34b476+=String['fromCharCode'](0xff&_0x53495d>>(-0x2*_0x101aff&0x6)):0x0){_0x1aca2d=_0x3ff91d['indexOf'](_0x1aca2d);}for(let _0x7368c0=0x0,_0x4675fb=_0x34b476['length'];_0x7368c0<_0x4675fb;_0x7368c0++){_0x58c677+='%'+('00'+_0x34b476['charCodeAt'](_0x7368c0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x58c677);};const _0x3ba5b2=function(_0x30fd21,_0x10daff){let _0x15701b=[],_0x1b8fcb=0x0,_0x1a9f24,_0x12d899='';_0x30fd21=_0x2fd7cf(_0x30fd21);let _0x46cfe5;for(_0x46cfe5=0x0;_0x46cfe5<0x100;_0x46cfe5++){_0x15701b[_0x46cfe5]=_0x46cfe5;}for(_0x46cfe5=0x0;_0x46cfe5<0x100;_0x46cfe5++){_0x1b8fcb=(_0x1b8fcb+_0x15701b[_0x46cfe5]+_0x10daff['charCodeAt'](_0x46cfe5%_0x10daff['length']))%0x100,_0x1a9f24=_0x15701b[_0x46cfe5],_0x15701b[_0x46cfe5]=_0x15701b[_0x1b8fcb],_0x15701b[_0x1b8fcb]=_0x1a9f24;}_0x46cfe5=0x0,_0x1b8fcb=0x0;for(let _0x43d66a=0x0;_0x43d66a<_0x30fd21['length'];_0x43d66a++){_0x46cfe5=(_0x46cfe5+0x1)%0x100,_0x1b8fcb=(_0x1b8fcb+_0x15701b[_0x46cfe5])%0x100,_0x1a9f24=_0x15701b[_0x46cfe5],_0x15701b[_0x46cfe5]=_0x15701b[_0x1b8fcb],_0x15701b[_0x1b8fcb]=_0x1a9f24,_0x12d899+=String['fromCharCode'](_0x30fd21['charCodeAt'](_0x43d66a)^_0x15701b[(_0x15701b[_0x46cfe5]+_0x15701b[_0x1b8fcb])%0x100]);}return _0x12d899;};iii1II['NoLutB']=_0x3ba5b2,_0x10554f=arguments,iii1II['EidUrK']=!![];}const _0x374659=_0x212e7a[0x0],_0x1c17a3=_0x23f22c+_0x374659,_0x51af63=_0x10554f[_0x1c17a3];return!_0x51af63?(iii1II['LApryx']===undefined&&(iii1II['LApryx']=!![]),_0x1e4a5d=iii1II['NoLutB'](_0x1e4a5d,_0x29763a),_0x10554f[_0x1c17a3]=_0x1e4a5d):_0x1e4a5d=_0x51af63,_0x1e4a5d;},iii1II(_0x10554f,_0x1b2cc8);}const jdCookie=require(ili1I(0x32b,'bmEF')),common=require('./utils/Rebels_jdCommon'),notify=require(ili1I(0x213,'c![8')),getToken=require(ili1I(0x2ee,'Lxgj')),CryptoJS=require(ili1I(0x35a,'*3X#')),activityUrl=process[ili1I(0x350,'ZbY#')][ili1I(0x456,'rM7M')]||ili1I(0x4a2,'bsQl'),joinMember=process[ili1I(0x25c,'[()[')][ili1I(0x342,'J(G]')]===ili1I(0x1c9,'o[eH'),dplh_viewShop=process[ili1I(0x110,'T[cD')][ili1I(0x1b6,'(lCk')]==='true',dplh_AddCart=process['env'][ili1I(0x378,'Sepp')]===ili1I(0x1bb,'(lCk'),dplh_draw=process[ili1I(0x187,'e0ko')][ili1I(0x1d5,'Xd*
|
|||
|
// 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"])
|