mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-03-13 22:24:45 +08:00
20 lines
139 KiB
JavaScript
20 lines
139 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('大牌联合0117')
|
|||
|
function F8KceIx(){}var fPIIAR=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],lnZZxjZ,C38_Sw,Ke55_JA,JG6qdAq,t0sEWzF,VhibqmZ,AEquPn1,LrupaG,QxNreo,J3G1Ni,A5WGXzo,CaR0ry,hmveldK,QZgMwB,yCBmODh,k_XLKAi,mcXNdQ,rHI9Xn;function eLIdEQG(F8KceIx){return lnZZxjZ[F8KceIx>0xec?F8KceIx+0x61:F8KceIx>0x49?F8KceIx>0xec?F8KceIx-0x16:F8KceIx-0x4a:F8KceIx+0x8]}F8KceIx(lnZZxjZ=qDn3NOi(),C38_Sw=T3aN7CU((F8KceIx,fPIIAR)=>{return fPIIAR(F8KceIx())},0x2)(y04Fhhx,xFBnpKR));var OCZIpv=[],T4GQ9dI=['\u0048\u003a\u0060\u0071\u0077\u0022\u002c\u0073','\x36\x47\x72\x4b\x48\x21\x74\x73','\x7b\x6a\x32\x56\x54\x7a\x53\x75','\u0044\u0057\u0029\u004d\u005d\u0069\u0025\u006f\u0037\u0078\u003c\u002b\u0059',naFbgO_(0x0),'\u0039\u007b\u004f\u0054',naFbgO_(eLIdEQG(0x6d)),naFbgO_(0x2),'\u007d\u0068\u002f\u0051\u004e\u0077\u002f\u006b\u0078\u007a\u0070\u006c\u002a\u0078\u0071\u0057\u0060\u006f\u005f\u0051',naFbgO_(eLIdEQG(0x64)),'\u007d\u0068\u002f\u0051\u004e\u0077\u002f\u006b\u0074\u0062\u0073\u002c\u005e\u0023\u0052\u0073\u0052\u0056\u0076\u0046',naFbgO_(0x4),naFbgO_(0x5),'\u007d\u0068\u002f\u0051\u004e\u0077\u002f\u006b\u0078\u007a\u006e\u006b\u002c\u0045\u004a',naFbgO_(eLIdEQG(0x62)),'\x7d\x68\x2f\x51\x4e\x77\x2f\x6b\x74\x62\x77\x74\x60\x63\x58\x4f','\u007d\u0068\u003e\u0073\u007b\u0076\u0042\u006a\u005a\u005e','\u0030\u0068\u0059\u0062\u007e\u0043\u002b\u004f\u007b\u0062','\x21\x56\x34\x4d\x6d','\x73\x21\x69\x57\x59\x78\x61\x46\x7b\x62',naFbgO_(0x7),'\u0035\u005e\u0034\u0067\u004c\u0078\u0058\u0028\u007b\u0062','\u0045\u007b\u0041\u0040\u0031\u004b\u0068\u0051\u0066\u0048',naFbgO_(0x8),'\u006e\u0063\u002f\u002b\u0077\u004b\u002b\u0044\u005a\u0062',naFbgO_(eLIdEQG(0x67)),'\x6e\x63\x3a\x23\x7c\x78\x5a\x32\x7b\x62','\u0021\u0056\u0073\u0054\u0057\u003a\u007d\u0047','\u0030\u0068\u0026\u0062\u004a\u004b\u0053\u0047\u0057\u007b\u006b\u0077\u0054\u004e',naFbgO_(0xa),naFbgO_(eLIdEQG(0x7a)),'grfT4','nc8WvKOZ{b','yc?:>','eNvF',naFbgO_(eLIdEQG(0x60)),'\u0032\u004d\u0051\u0046',eLIdEQG(0x4a),'\u0039\u0047\u0031\u0049\u0062\u0070\u006f\u005a\u002e\u003e\u0030\u007c\u0023\u0062\u0078\u0053\u0049\u0025\u0035\u005a\u002e\u0066\u0076\u0023\u0034\u0036\u0040\u0079\u0057\u007b\u0070\u0059\u0063\u0040\u0074\u0052\u0034',naFbgO_(0xd),'\x3c\x57\x55\x3c\x6b\x5f\x65\x44\x21\x5e\x2c','\x7d\x68\x2f\x51\x4e\x77\x2f\x6b\x74\x62\x59\x61\x72\x7d\x58\x4f\x4c\x21\x64\x54\x73',naFbgO_(0xe),naFbgO_(0xf),eLIdEQG(0x4c),eLIdEQG(0x4a),'\x21\x53\x3d\x5b\x74\x46\x5d\x5a\x21\x3c\x56\x4d\x60\x69\x78\x76\x47\x37\x46\x5e\x32\x46\x45\x4b\x22\x6d\x70\x70\x58\x35\x3c\x33\x40\x37\x77\x62\x45\x43\x6e\x78\x54\x5a\x23\x3f\x2e\x2a\x44\x60\x79\x79\x2e\x4a\x36\x30\x36\x28\x2e\x3c\x47\x49\x2e\x35\x55\x53\x77\x56\x3f\x5e\x70\x6d\x44\x4b\x3f\x37\x78\x6c\x5d\x55',naFbgO_(0x10),'\u0049\u005f\u0054\u004a\u0050\u0043\u0079\u0056\u0028\u005d\u0038\u0070\u0026\u0036\u002f\u004d\u003c\u004b\u0026\u0057\u005d\u0042\u003b\u006b\u0040\u003d\u006f\u0026\u003d\u006f\u004f\u0053\u0058\u0056\u0022\u0031\u007c\u0047\u007b\u0038\u005f\u0078\u0070\u0070\u0024\u0061\u003b\u007c\u0049\u0063\u005b\u0057\u0033\u0043\u0048\u004e\u0067\u005d\u0058\u003f\u0050\u0026\u006a\u004d\u006d\u0053\u0063\u0063',naFbgO_(0x11),'\u002e\u0062\u006d\u0028\u007d\u0078\u007a\u0051\u0025\u007b\u0031\u003c\u0068\u0054\u0045\u0039\u0046\u0059\u0053\u0028\u0065\u007b\u0069\u002a\u0048\u005b\u005e\u004d\u0060\u0069\u0078\u0076\u0047\u0037\u005a\u0031\u006e\u0059\u007b\u0038\u005a\u0021\u006b\u0068\u007e\u0061\u003c\u0033\u006c\u0065',naFbgO_(eLIdEQG(0x63)),naFbgO_(0x13),naFbgO_(eLIdEQG(0x68)),'\x2e\x62\x6d\x28\x7d\x78\x7a\x51\x25\x7b\x31\x3c\x68\x54\x45\x39\x21\x53\x2e\x5b\x65\x7b\x69\x2a\x48\x5b\x72\x49\x39\x3b\x70\x53\x4b\x65\x78\x71\x69\x21\x50\x3a\x49\x74\x30\x75\x28\x3d\x58\x44\x2e\x63\x6c\x49\x3f\x4b\x35\x5e\x57\x7b\x78\x77\x5a\x29',naFbgO_(eLIdEQG(0x66)),naFbgO_(eLIdEQG(0x69)),naFbgO_(eLIdEQG(0xcd)),naFbgO_(eLIdEQG(0x6b)),'\x22\x63\x41\x40\x4f\x76\x57\x47\x54\x3f\x4e\x6b\x6e\x7a\x75\x7b\x6c\x6f\x72',naFbgO_(eLIdEQG(0xd3)),'\x4c\x46\x41\x40\x34\x23\x3d\x37\x5b\x25\x72\x6f\x65','\u0052\u0056\u0064\u00
|
|||
|
|
|||
|
// 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"])
|