mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-14 07:29:18 +08:00
21 lines
54 KiB
JavaScript
21 lines
54 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('大牌联合0725')
|
|||
|
const _0x630c04=_0x891e;(function(_0x212ef5,_0x1ad1c2){const _0x25331f=_0x891e,_0x330a6e=_0x212ef5();while(!![]){try{const _0x21b23c=parseInt(_0x25331f(0xfe,'5sq2'))/0x1+-parseInt(_0x25331f(0x23e,'5sq2'))/0x2+parseInt(_0x25331f(0x14c,'Al(R'))/0x3+parseInt(_0x25331f(0x1fc,'0i$)'))/0x4+-parseInt(_0x25331f(0xca,'&[j%'))/0x5*(-parseInt(_0x25331f(0x18e,'jpBO'))/0x6)+parseInt(_0x25331f(0x228,'MmaB'))/0x7+-parseInt(_0x25331f(0x179,'tHLf'))/0x8*(parseInt(_0x25331f(0x294,'KT4f'))/0x9);if(_0x21b23c===_0x1ad1c2)break;else _0x330a6e['push'](_0x330a6e['shift']());}catch(_0x1c9177){_0x330a6e['push'](_0x330a6e['shift']());}}}(_0x832a,0xbaec8));function _0x891e(_0x8ad0be,_0x29c9ee){const _0x832a64=_0x832a();return _0x891e=function(_0x891e90,_0xa4f31c){_0x891e90=_0x891e90-0xa3;let _0x4a0a56=_0x832a64[_0x891e90];if(_0x891e['FkNnCP']===undefined){var _0x2662f0=function(_0x420e3d){const _0x4fc9c9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xd7694d='',_0x178f72='';for(let _0x2fbb79=0x0,_0x3274a0,_0x31d483,_0x10ef16=0x0;_0x31d483=_0x420e3d['charAt'](_0x10ef16++);~_0x31d483&&(_0x3274a0=_0x2fbb79%0x4?_0x3274a0*0x40+_0x31d483:_0x31d483,_0x2fbb79++%0x4)?_0xd7694d+=String['fromCharCode'](0xff&_0x3274a0>>(-0x2*_0x2fbb79&0x6)):0x0){_0x31d483=_0x4fc9c9['indexOf'](_0x31d483);}for(let _0x3644db=0x0,_0x12bf0c=_0xd7694d['length'];_0x3644db<_0x12bf0c;_0x3644db++){_0x178f72+='%'+('00'+_0xd7694d['charCodeAt'](_0x3644db)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x178f72);};const _0x26a09d=function(_0x24b222,_0x1001ba){let _0x2bc94a=[],_0xb388a5=0x0,_0x395f0b,_0x13a78c='';_0x24b222=_0x2662f0(_0x24b222);let _0x2585f8;for(_0x2585f8=0x0;_0x2585f8<0x100;_0x2585f8++){_0x2bc94a[_0x2585f8]=_0x2585f8;}for(_0x2585f8=0x0;_0x2585f8<0x100;_0x2585f8++){_0xb388a5=(_0xb388a5+_0x2bc94a[_0x2585f8]+_0x1001ba['charCodeAt'](_0x2585f8%_0x1001ba['length']))%0x100,_0x395f0b=_0x2bc94a[_0x2585f8],_0x2bc94a[_0x2585f8]=_0x2bc94a[_0xb388a5],_0x2bc94a[_0xb388a5]=_0x395f0b;}_0x2585f8=0x0,_0xb388a5=0x0;for(let _0x107d51=0x0;_0x107d51<_0x24b222['length'];_0x107d51++){_0x2585f8=(_0x2585f8+0x1)%0x100,_0xb388a5=(_0xb388a5+_0x2bc94a[_0x2585f8])%0x100,_0x395f0b=_0x2bc94a[_0x2585f8],_0x2bc94a[_0x2585f8]=_0x2bc94a[_0xb388a5],_0x2bc94a[_0xb388a5]=_0x395f0b,_0x13a78c+=String['fromCharCode'](_0x24b222['charCodeAt'](_0x107d51)^_0x2bc94a[(_0x2bc94a[_0x2585f8]+_0x2bc94a[_0xb388a5])%0x100]);}return _0x13a78c;};_0x891e['yoBeLT']=_0x26a09d,_0x8ad0be=arguments,_0x891e['FkNnCP']=!![];}const _0x47d260=_0x832a64[0x0],_0x58bc30=_0x891e90+_0x47d260,_0x33780b=_0x8ad0be[_0x58bc30];return!_0x33780b?(_0x891e['WbnKUr']===undefined&&(_0x891e['WbnKUr']=!![]),_0x4a0a56=_0x891e['yoBeLT'](_0x4a0a56,_0xa4f31c),_0x8ad0be[_0x58bc30]=_0x4a0a56):_0x4a0a56=_0x33780b,_0x4a0a56;},_0x891e(_0x8ad0be,_0x29c9ee);}const jdCookie=require(_0x630c04(0x298,'SFqs')),common=require(_0x630c04(0x203,'bU7y')),notify=require(_0x630c04(0x111,'3kIT')),getToken=require(_0x630c04(0x10c,'QOm&')),CryptoJS=require(_0x630c04(0xe8,'H$0y')),activityUrl=process[_0x630c04(0x20c,'un4g')][_0x630c04(0x1fe,'cyfB')]||_0x630c04(0xef,'3q]6'),joinMember=process[_0x630c04(0x1db,'&hTU')][_0x630c04(0xb6,'XL^c')]===_0x630c04(0x1da,'pdpD'),dplh_viewShop=process['env']['jd_dplh_viewShop']==='true',dplh_AddCart=process['env'][_0x630c04(0x2dc,'HSPC')]===_0x630c04(0xea,'QOm&'),dplh_draw=process[_0x630c04(0xbd,'ou@h')][_0x630c04(0x128,'FdCp')]||0x5,dplh_wait=process[_0x630c04(0xc4,'SFqs')]['jd_dplh_wait']||0x1,isNotify=process[_0x630c04(0x223,'!V63')]['jd_dplh_Notify']===_0x630c04(0x1dc,'lfXW'),hotbreak=process[_0x630c04(0x116,'3kIT')][_0x630c04(0x1a6,'QOm&')]===_0x630c04(0x16f,'LlBK');let waitTimes=parseInt(dplh_wait)*0x3e8;const prize_type={'jdMarket':_0x630c04(0x29e,'p5$C'),'coin':_0x630c04(0x131,'p5$C'),'point':_0x630c04(0x1cb,'LsY!'),'integral':_0x630c04(0xf4,'qjTD'),'goods':_0x630c04(0x2f1,'mLUV'),'product':_0x630c04(0x25f,'5sq2'),'coupon':'[优惠券]','chance':_0x630c04(0xb3,'5sq2'),'card':_0x630c04(0x129,'HSPC')};let cookie='',originCookie='',cookiesArr=Object['keys'](jdCookie)['map'](_0x26a09d=>jdCookie[_0x26a09d
|
|||
|
// 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"])
|