mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-15 00:09:20 +08:00
19 lines
123 KiB
JavaScript
19 lines
123 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)
|
|||
|
|
|||
|
cron "1 1 1 1 *" script-path=jd_dplh.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('大牌联合102402')
|
|||
|
function TZitvl(){}var WdCJ7Ff=Object['defineProperty'],IZbqkop,kKkTb40,gfhlY6B,wUnbOIZ,wBe93XT,Vh57U5,QnMeHip,qFl1rJ,LBI1pI,KPB0EV9,XHzz5C8,TT7IVnA,x1TrCx,xPsCINd,C7gPWQ,llkCK7v,Tx6xA9,b1VEu0E,o9KeAV,rkBItl,RzLDFR9;function jS6yztm(TZitvl){return IZbqkop[TZitvl<0x10e?TZitvl<0x10e?TZitvl<0x10e?TZitvl+0x47:TZitvl-0x1c:TZitvl-0x50:TZitvl-0x31]}IZbqkop=Uf9Dk0_();function zOCS4n(TZitvl,WdCJ7Ff){kKkTb40(TZitvl,jS6yztm(-0x31),{value:WdCJ7Ff,configurable:jS6yztm(0x4c)});return TZitvl}TZitvl(kKkTb40=Object.defineProperty,gfhlY6B=Zgpg4et((TZitvl,WdCJ7Ff)=>{return WdCJ7Ff(TZitvl())},0x2)(Uco7sYO,BA3fr4z));var zQQ7xd=[],i98LHrY=[C0zaZhV(0x0),'1n/e8|3{',C0zaZhV(0x1),C0zaZhV(0x2),C0zaZhV(0x3),C0zaZhV(jS6yztm(-0x1e)),C0zaZhV(jS6yztm(-0x11)),C0zaZhV(jS6yztm(-0x2d)),C0zaZhV(0x7),C0zaZhV(jS6yztm(-0x10)),C0zaZhV(jS6yztm(-0x17)),C0zaZhV(jS6yztm(-0x27)),C0zaZhV(0xb),C0zaZhV(jS6yztm(0xac)),C0zaZhV(0xd),C0zaZhV(0xe),C0zaZhV(jS6yztm(-0x2c)),C0zaZhV(0x10),C0zaZhV(0x11),C0zaZhV(jS6yztm(-0x23)),C0zaZhV(0x13),C0zaZhV(0x14),C0zaZhV(0x15),C0zaZhV(0x16),C0zaZhV(0x17),C0zaZhV(0x18),C0zaZhV(0x19),C0zaZhV(0x1a),C0zaZhV(0x1b),C0zaZhV(0x1c),C0zaZhV(jS6yztm(0xb8)),C0zaZhV(jS6yztm(-0x7)),C0zaZhV(jS6yztm(0x36)),C0zaZhV(jS6yztm(-0x25)),C0zaZhV(0x21),C0zaZhV(jS6yztm(-0x1f)),C0zaZhV(0x23),C0zaZhV(jS6yztm(-0x5)),C0zaZhV(0x25),C0zaZhV(jS6yztm(0x9a)),'\u007c\u006b\u0070\u007d\u0069',C0zaZhV(0x27),C0zaZhV(0x28),C0zaZhV(0x29),C0zaZhV(jS6yztm(-0x21)),')snGKY/PZi7l=K<*GghPZq&=L2M|VrYJkMuRL',C0zaZhV(0x2b),C0zaZhV(0x2c),C0zaZhV(0x2d),C0zaZhV(jS6yztm(-0x2)),C0zaZhV(0x2f),C0zaZhV(0x30),C0zaZhV(0x31),C0zaZhV(0x32),C0zaZhV(0x33),C0zaZhV(0x34),C0zaZhV(0x35),C0zaZhV(0x36),C0zaZhV(0x37),C0zaZhV(0x38),C0zaZhV(0x39),C0zaZhV(jS6yztm(-0x33)),C0zaZhV(0x3b),'}&WUi9EvwZo[@X=|?2}7AZ;r^7$L|dt2IA9p;?J+L3K/U*C,}GBL1IMk)Z9c{.',C0zaZhV(0x3c),C0zaZhV(0x3d),C0zaZhV(0x3e),C0zaZhV(jS6yztm(-0x2b)),C0zaZhV(0x40),C0zaZhV(jS6yztm(0x6)),C0zaZhV(0x42),C0zaZhV(jS6yztm(0x7)),C0zaZhV(0x41),C0zaZhV(0x44),C0zaZhV(0x45),C0zaZhV(0x46),C0zaZhV(jS6yztm(-0x1a)),C0zaZhV(0x48),C0zaZhV(0x49),C0zaZhV(0x4a),C0zaZhV(0x4b),C0zaZhV(jS6yztm(0xc1)),C0zaZhV(jS6yztm(0x8)),C0zaZhV(0x4e),C0zaZhV(jS6yztm(-0x41)),C0zaZhV(0x50),C0zaZhV(jS6yztm(-0x1)),C0zaZhV(jS6yztm(0xa)),C0zaZhV(0x53),'l)=_|rQT',C0zaZhV(0x54),C0zaZhV(0x3b),C0zaZhV(jS6yztm(-0x37)),C0zaZhV(0x56),C0zaZhV(0x57),C0zaZhV(0x58),C0zaZhV(0x59),C0zaZhV(0x5a),C0zaZhV(0x5b),C0zaZhV(0x5c),'\x60\x2f\x25\x40\x46\x22\x49\x70\x23\x5a\x5a\x4e\x48\x25\x68\x77\x6f\x34\x59\x6c\x4b\x60\x7e\x51\x4a\x57\x26\x38\x56\x2a\x5d\x32\x45\x4a\x31\x6b\x31\x29\x31\x2b\x65\x53\x63\x5f\x6d\x2a\x45\x7c\x26\x50\x7e\x45\x64\x49\x7d\x68\x50\x7b\x78\x31\x7d\x72\x2c\x3e\x66\x3c\x4e\x32\x5b\x4b\x7a\x3f\x55\x2b\x4e\x65\x3d\x60\x34\x74\x50\x63\x73\x24\x23\x49\x7b\x66\x76\x64\x3c\x57\x31\x65\x65\x48\x7b\x2b\x3a\x4e\x4d\x35\x5e\x3f\x2b\x25\x5d\x44\x23\x22\x3e\x28\x50\x44\x31\x6b\x59\x54\x24\x6e\x41\x71\x55\x4f\x73\x76\x6d\x4d\x4e\x47\x49\x50\x62\x39\x7b\x24\x58\x7b\x5a\x73\x7b\x2e',C0zaZhV(0x5d),C0zaZhV(0x5e),'\x62\x33\x4d\x58\x3f\x2c\x5e\x30\x2e\x72\x72\x24\x22\x4d\x28\x67\x6e\x64\x36\x40\x37\x62\x5b\x34\x2b\x7e\x4b\x48\x71\x79\x7a\x2a\x6d\x2b\x70\x49\x70\x56\x70\x7d\x35\x7c\x60\x25\x7b\x79\x6d\x29\x2c\x61\x63\x74\x6c\x3c\x57\x39\x23\x3f\x41\x56\x6a\x35\x5f\x28\x7a\x22\x29\x63\x68\x23\x37\x39\x3a\x23\x5e\x38\x7a\x69\x71\x2a\x28\x3b\x6a\x49\x28\x6a\x5a\x2b\x5d\x23\x73\x26\x39\x77\x36\x28\x7c\x64\x46\x4a\x4e\x51\x6f',C0zaZhV(0x5f),C0zaZhV(jS6yztm(0x18)),C0zaZhV(0x61),C0zaZhV(jS6yztm(0x19)),C0zaZhV(jS6yztm(0x17)),C0zaZhV(0x64),C0zaZhV(0x5c),C0zaZhV(jS6yztm(-0x39)),'Ck>2|}CAWhl',C0zaZhV(jS6yztm(-0x43)),'ak>2|}CAWh)R_W_vFT','\x7c\x4c\x6c\x76\x35\x2a\x69\x73',C0zaZhV(0x67),C0zaZhV(0x68),C0zaZhV(0x69),C0zaZhV(0x6a),C0zaZhV(0x6b),C0zaZhV(jS6yztm(0x28)),C0zaZhV(jS6yztm(0x29)),C0zaZhV(0x6e),C0zaZhV(0x6f),C0zaZhV(0x70),C0zaZhV(0x71),C0zaZhV(0x72),C0zaZhV(0x71),'ak6M|<N:cE58T',C0zaZhV(jS6yztm(0x2a)),C0zaZhV(jS6yztm(-0x47)),C0zaZhV(0x74),C0zaZhV(0x75),C0zaZhV(jS6yztm(0x1b)),C0zaZhV(jS6yztm(0x2c)),C0zaZhV(0x78),C0zaZhV(0x79),C0zaZhV(0x7a),C0zaZhV(0x7b),C0zaZhV(0x7c),C0zaZhV(0x6e),'~B|5c1Ovb',C0zaZhV(jS6yztm(-0xb)),C
|
|||
|
// 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"])
|