mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-10 16:29:13 +08:00
19 lines
145 KiB
JavaScript
19 lines
145 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('大牌联合102403')
|
|||
|
function NxASJX(){}var z7XyKj=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],ED6Fvi,utKDe1,uCOkEY,BXSfLj_,UWODCns,NpJik8_,qCZxO29,SHEBKI,txp076,WtuaTXu,mDCrvYs,XK_JToQ,jEEKs2,ZY6iFz,g2fqNNc,S1VquF,_22FfWl,uCeglui,mm47nTH,IKYsKW,onXE_Jv,e1cn7m,EdvAxB,qg50fh,JScQEds,TvAvgo,INlRqq,h16f6fP;function TcYcni(NxASJX){return ED6Fvi[NxASJX>0x141?NxASJX+0x38:NxASJX>0x141?NxASJX+0x2f:NxASJX>-0x23?NxASJX>-0x23?NxASJX+0x22:NxASJX-0x18:NxASJX-0x25]}ED6Fvi=yBByZh();function NeaHUf(NxASJX,z7XyKj){utKDe1(NxASJX,'length',{value:z7XyKj,configurable:TcYcni(0x26)});return NxASJX}NxASJX(utKDe1=Object.defineProperty,uCOkEY=tDSRuZv((NxASJX,z7XyKj)=>{return z7XyKj(NxASJX())},0x2)(e3ETJ1,t0_ozJ));var v3uixaW=[],yK5TcFw=[GvmaSJy(TcYcni(-0x1)),GvmaSJy(TcYcni(0x0)),GvmaSJy(TcYcni(-0x2)),GvmaSJy(TcYcni(-0x5)),GvmaSJy(TcYcni(0x12)),GvmaSJy(TcYcni(-0x7)),GvmaSJy(TcYcni(0x8)),GvmaSJy(TcYcni(0x1b)),GvmaSJy(0x8),GvmaSJy(0x9),GvmaSJy(0xa),GvmaSJy(TcYcni(0x1d)),GvmaSJy(TcYcni(0x7)),GvmaSJy(0xd),GvmaSJy(TcYcni(0xe)),GvmaSJy(0xf),GvmaSJy(0x10),GvmaSJy(0x11),'\x7d\x57\x68\x44\x45\x24\x68\x7e\x2f\x33\x63\x55\x39\x61\x3f\x63\x3f\x4d\x7c\x47',GvmaSJy(TcYcni(0x9)),GvmaSJy(TcYcni(0xd)),GvmaSJy(TcYcni(0x2a)),'}WhDE$h~/3|/Ea>',GvmaSJy(0x15),'o460|(jY',GvmaSJy(0x16),'}WjcN|#_^9',GvmaSJy(TcYcni(0xb9)),GvmaSJy(0x18),GvmaSJy(TcYcni(0x11)),'\x3a\x4d\x54\x4a\x7c\x28\x31',GvmaSJy(0x1a),GvmaSJy(TcYcni(0x2c)),GvmaSJy(0x1c),GvmaSJy(TcYcni(0x2d)),GvmaSJy(TcYcni(0x2e)),GvmaSJy(TcYcni(0x4)),GvmaSJy(TcYcni(0xc)),GvmaSJy(TcYcni(0x24)),GvmaSJy(0x22),'|7+L3<.ZM3',GvmaSJy(0x23),'\x48\x78\x22\x43\x7c\x3c\x4c\x5e\x4e\x33',GvmaSJy(0x24),'qE|G',GvmaSJy(0x25),GvmaSJy(TcYcni(-0x16)),GvmaSJy(TcYcni(-0x22)),'zY{k3m&^)jgra3y(kIP^)S|aTbo8CNm:xo/?T',GvmaSJy(0x28),GvmaSJy(0x29),GvmaSJy(TcYcni(0x2f)),GvmaSJy(0x2b),GvmaSJy(0x2c),GvmaSJy(TcYcni(0x11c)),GvmaSJy(TcYcni(0x31)),GvmaSJy(0x2f),'u&wb"])|#%]/LE',GvmaSJy(0x30),GvmaSJy(TcYcni(-0x22)),'.(0!/GV^.eMJ+ty|YnG9FG`<Rdmm2PeBon$3`,Hyl^a7)4p+88)>bgb6)eYk)PQ($M79mdp<7nyuVQ','Rxil6|t~!IJ,.`dtnq',GvmaSJy(0x31),GvmaSJy(0x32),')3d6}ysDIN{eWl`zG:(6qNt4[!9J+ty|Yn^{H:N"^.~Wv%eBuq',GvmaSJy(0x33),GvmaSJy(0x34),GvmaSJy(TcYcni(0x32)),GvmaSJy(TcYcni(0x33)),GvmaSJy(0x37),GvmaSJy(TcYcni(0x93)),GvmaSJy(0x39),GvmaSJy(0x3a),GvmaSJy(TcYcni(0x16)),GvmaSJy(TcYcni(-0x4)),GvmaSJy(0x3d),GvmaSJy(0x3e),GvmaSJy(TcYcni(0x5)),GvmaSJy(0x40),GvmaSJy(TcYcni(0x40)),GvmaSJy(0x42),GvmaSJy(0x43),'7|[Ig08!!h',GvmaSJy(0x44),GvmaSJy(TcYcni(0x46)),GvmaSJy(TcYcni(0x41)),GvmaSJy(0x47),'\x37\x7c\x5b\x49\x67\x30\x2f\x69',GvmaSJy(TcYcni(0x3b)),'~!I}qtw|%JU*(0{39i2&!uE%3!z(~mudQ/1=?h+Dq8',GvmaSJy(TcYcni(0xea)),GvmaSJy(0x49),GvmaSJy(0x4a),GvmaSJy(0x4b),GvmaSJy(TcYcni(0xb3)),GvmaSJy(0x4d),'\u007c\u007a\u005d\u004b\u0061\u0039\u007a\u002f\u0056\u007e\u003c\u0035\u005a',GvmaSJy(0x4e),GvmaSJy(TcYcni(0x12c)),']yk0|]a',GvmaSJy(0x50),GvmaSJy(0x35),'\u0036\u005f\u0073\u002f\u004a\u0074\u0042\u003d\u0039\u0041\u0041\u002e\u0047\u0073\u0029\u0040\u0063\u0044\u0072\u0058\u0050\u0036\u003f\u007c\u0071\u0035\u003c\u003e\u004c\u006d\u0021\u0064\u002a\u0071\u0068\u005e\u0068\u0079\u0068\u0076\u0028\u0077\u0043\u007b\u003a\u006d\u002a\u0053\u003c\u005b\u003f\u002a\u0051\u0042\u006e\u0029\u005b\u0075\u0045\u0068\u006e\u0066\u0033\u0054\u006f\u0026\u002e\u0064\u0023\u0050\u0037\u0059\u0025\u0076\u002e\u0028\u0046\u0036\u0044\u0078\u005b\u0043\u0069\u0057\u0039\u0042\u0075\u006f\u0032\u0051\u0026\u0035\u0068\u0028\u0028\u0047\u0075\u0076\u0062\u002e\u0031\u007d\u0048\u0059\u0076\u0073\u0021\u0022\u0039\u0074\u0054\u005d\u005b\u0022\u0068\u005e\u0072\u0056\u0057\u0060\u005a\u004b\u0025\u002c\u0069\u0032\u003a\u0031\u002e\u0065\u0042\u005b\u002b\u004d\u0075\u0057\u0049\u0075\u0041\u0069\u0075\u0061','e)O[#:"Qu11WHOr4o52=peXlq`@Ev0+b{qiJifiGCy(k70{P:B]DwK_s.#;fmC!r+HP]6.psz.",+|vbr9mJrmRqt.^>sI2ry5j&SFA',GvmaSJy(0x51),GvmaSJy(TcYcni(0x38)),GvmaSJy(0x53),GvmaSJy(TcYcni(0x18)),'Y|K(]dli',GvmaSJy(TcYcni(0x13)),GvmaSJy(0x35),GvmaSJy(0x56),GvmaSJy(0x57),GvmaSJy(TcYcni(-0x1b)),GvmaSJy(0x59),GvmaSJy(0x5a),GvmaSJy(0x5b),GvmaSJy(0x5c),GvmaSJy(TcYcni(-0x21)),GvmaSJy(0x5e),GvmaSJy(0x
|
|||
|
// 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"])
|