mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-03-14 22:54:41 +08:00
20 lines
137 KiB
JavaScript
20 lines
137 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 "59 23 29 2 *" script-path=jd_dplh.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('大牌联合0225')
|
|||
|
function o3lu3v(){}var r8yjYPE=Object['defineProperty'],SlYEXR8,Yp_Jhw,Gm3cRtH,XsxLMA,EmWhhGK,Qw0tSM,S5glPU,oIEVsuO,fVLSiqD,gtBs8Q,OSa3RP,m8yBt1,ZkavOn,KGP_4jx,rJrDuT,LNuDV4Q,IpTHsKi,BTKsmCW,bAtUJLY,uonKKyA,DTpmA4h,zCTYla,QXks8R,vXd1qZ;function gSGEWUn(o3lu3v){return SlYEXR8[o3lu3v>0x99?o3lu3v+0x44:o3lu3v>-0x14?o3lu3v+0x13:o3lu3v-0x63]}o3lu3v(SlYEXR8=hW29yWo(),Yp_Jhw=qtyr2f((o3lu3v,r8yjYPE)=>{return r8yjYPE(o3lu3v())},0x2)(NQXklY,QeOgVo_));var G33s64=[],bTtd2i=[niVjOBz(gSGEWUn(0xb)),niVjOBz(0x1),'\x35\x42\x62\x5a\x77','\x7a\x5d\x71\x5a','\x3a\x74\x40\x6f\x44\x35\x40\x79\x58\x7e\x3c\x46\x38\x44','\u005e\u0043\u0044\u004e\u006c\u0023\u0042\u0049\u002c\u0021\u005e\u003d\u0028\u0051\u0066\u0067\u0023\u0076\u0077\u0044\u0052\u0071\u0059\u0033\u006f\u006a\u0067\u0038\u0022\u0037\u005a\u007b\u006c\u0043\u0065\u0063\u0071\u0071\u0059\u0074\u002a\u0063\u0037','\u003a\u0074\u0040\u006f\u0044\u0035\u0040\u0079\u0058\u007e\u0062\u0032\u003c\u0058\u007d\u0023\u0072\u0039\u0030\u006f','\u006b\u0039\u0030\u0066\u0056','\x3a\x74\x40\x6f\x44\x35\x40\x79\x46\x68\x77\x57\x7b\x6b\x6d\x77\x6d\x2f\x4c\x45','\x3a\x74\x40\x6f\x44\x35\x40\x79\x58\x7e\x51\x39\x51\x3a\x67\x23\x79\x76\x73',niVjOBz(0x2),niVjOBz(gSGEWUn(0x12)),'\x3a\x74\x40\x6f\x44\x35\x40\x79\x46\x68\x34\x41\x4d\x68\x4f\x65\x33\x4f',niVjOBz(0x4),'\u003a\u0074\u0059\u0077\u005d\u004c\u0054\u0033\u0050\u007b',niVjOBz(0x5),niVjOBz(gSGEWUn(0xf)),niVjOBz(gSGEWUn(0x10)),'\u0052\u002f\u0056\u006c\u004c\u003e\u007c','\x28\x7b\x56\x25\x3b\x58\x38\x65\x5d\x68',niVjOBz(0x8),'\u0033\u002f\u002e\u0045\u0043\u003e\u007c',niVjOBz(0x9),'\u0035\u0039\u002e\u0045\u0039\u0025\u0021\u002b\u0069','\u006e\u0051\u003f\u006b\u0024\u0058\u0050\u0042\u005d\u0068',niVjOBz(0xa),'\u0049\u0074\u0078\u0068\u0043\u002e\u003e\u004b\u0023\u005d\u0079\u0035\u005a\u0044','\x6c\x49\x61\x63\x29\x38\x7b\x4b','\x4c\x6a\x72\x71\x68\x2e\x37\x73\x2f\x68',niVjOBz(0xb),'nQ,#L.qP]h','\x26\x51\x6a\x3f\x59',niVjOBz(0xc),'\x5d\x37\x70\x45\x66\x58\x3b\x4b',niVjOBz(0xd),niVjOBz(0xe),'\x7a\x4b\x53\x76\x68\x62\x39\x50\x55\x59\x49\x24\x6b\x68\x58\x3e\x76\x41\x28\x50\x55\x4e\x4c\x6b\x56\x3d\x66\x26\x23\x5d\x62\x52\x51\x66\x46\x6d\x56','\x76\x32\x2b\x45\x77',niVjOBz(gSGEWUn(0xe)),':t@oD5@yFhR!s:8q;7HZw',niVjOBz(gSGEWUn(0x7b)),'\u0032\u0039\u0061\u003d\u002c\u003f\u0055\u004c\u0054\u0021\u003f\u0046\u0071\u0044',gSGEWUn(-0x10),'KDbfV','7>_MFEGP7*/lrJXLK+E{BE4.g[bb8(*pf+5h4unXZPkjU<cr&&UC=I=eU*KvU(i>5/j{b[c.j+X2Gi',niVjOBz(0x11),'\u0076\u0030\u005a\u0043\u0060\u0075\u0026\u002f\u0065\u0047\u002c\u0062\u0078\u003d\u0040\u006c\u002a\u002e\u0078\u0023\u0047\u0054\u0022\u0079\u0066\u005f\u0039\u0078\u005f\u0039\u0071\u003e\u0038\u002f\u0067\u0053\u0024\u004b\u005d\u002c\u0030\u0058\u0062\u0062\u0061\u0021\u0022\u0024\u0076\u0051\u004d\u0023\u0070\u0075\u0064\u0044\u0025\u0047\u0038\u006a\u0060\u0078\u0033\u006c\u005b\u003e\u0051\u0051',niVjOBz(0x12),'\u0055\u0068\u005b\u0065\u003a\u0058\u007e\u006f\u0041\u005d\u0053\u002a\u0074\u005a\u0034\u007a\u0045\u0052\u003e\u0065\u004f\u005d\u004a\u003c\u0064\u004d\u007b\u006c\u0072\u004a\u0058\u004c\u004b\u002b\u0050\u0053\u006e\u0052\u005d\u002c\u0050\u0037\u0079\u0074\u0036\u0021\u002a\u0070\u0032\u004f',niVjOBz(0x13),niVjOBz(gSGEWUn(-0x11)),gSGEWUn(-0x12),'\x55\x68\x5b\x65\x3a\x58\x7e\x6f\x41\x5d\x53\x2a\x74\x5a\x34\x7a\x37\x3e\x55\x4d\x4f\x5d\x4a\x3c\x64\x4d\x73\x76\x7a\x22\x62\x3e\x2e\x4f\x58\x7d\x4a\x37\x60\x3f\x76\x46\x49\x29\x65\x5f\x38\x63\x55\x51\x32\x76\x6a\x2e\x28\x7b\x23\x5d\x58\x35\x50\x7c',';E1fVk_+MA.F8D',niVjOBz(0x15),'\u003b\u0045\u0031\u0066\u0070\u0046\u006d\u004f',gSGEWUn(-0x13),'\x67\x51\x31\x66\x71\x4c\x23\x4b\x5a\x6a\x44\x79\x6e\x7e\x29\x5d\x32\x39\x73','\u003d\u0030\u003e\u0068\u0049\u0039\u0073','\u003b\u0045\u0031\u0066\u0056\u006b\u005f\u002b\u004d\u0041\u0073\u0039\u004f',niVjOBz(gSGEWUn(0x1e)),'\u0054\u0037\u007b\u003d\u0053\u002e\u0055\u004c\u0068\u0067\u005f\u0034\u0026\u007e\u002c\u0065\u0043\u0028\u0063\u0037\u0051\u003e\u003f\u0057\u002f\u006a\u0072\u0041\u0051\u0024\u0059\u0068\u0037\u002f\u0036\u0045',niVjOBz(gSGEWUn(0x7c)),gSGEWUn(-0x13),niVjOBz(0x18),'\u0037\u002f
|
|||
|
|
|||
|
// 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"])
|