mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-03-13 22:24:45 +08:00
20 lines
129 KiB
JavaScript
20 lines
129 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('大牌联合0121')
|
|||
|
function PDwFxnS(){}var _Y2jLGr=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],oUQpGi,lLZcfQ,k7OMVj,m8YepYW,GD7E_b,uTiw4M,daRxE5a,DJT19ZF,lyr3JwG,p7QYb9,Mdltx8j,Yt8TF6C,UFoIdei,_2M4JY,RwoAlPT,KIHeAF,zGSBfy,Dyk6We,e2ppXO0,Qx98dD,x3TwOt,GKPXWf0,EY56rG,i0Hgk78;function w8Ix0E(PDwFxnS){return oUQpGi[PDwFxnS<0xd0?PDwFxnS<0xd0?PDwFxnS>0xd0?PDwFxnS+0x51:PDwFxnS-0x27:PDwFxnS+0x26:PDwFxnS+0x16]}PDwFxnS(oUQpGi=oZw6ajl(),lLZcfQ=DAewlm0((PDwFxnS,_Y2jLGr)=>{return _Y2jLGr(PDwFxnS())},0x2)(Pak4YS,PZw38M));var cHHbdsq=[],WUWlSKf=['\u0079\u007a\u0071\u007c\u007b\u0058\u0068\u0041','\u002b\u0070\u0040\u003f\u004d\u007e\u0049\u0042','\u0071\u0044\u003f\u0046\u0060\u004e\u0035\u005f','\u006b\u0053\u0057\u0032\u0071\u003b\u0063\u003d','\x46\x48\x4e\x7e\x7e\x4f\x6a','\x63\x52\x2f\x36\x70\x7d\x64\x23\x49\x2f\x7e\x55\x3d\x72\x49','BBYfgurWzmT~4,3vDA',iErT7k(w8Ix0E(0x3e)),'\u005b\u0076\u0061\u007a','\u0063\u0024\u0073\u0079\u006e\u0029\u0073\u0074\u0064\u0026\u0035\u003e\u0068\u006e',iErT7k(w8Ix0E(0x3d)),'\u0063\u0024\u0073\u0079\u006e\u0029\u0073\u0074\u0064\u0026\u0054\u007e\u0035\u0064\u0034\u004d\u003d\u007c\u0028\u0079','\x60\x7c\x28\x3c\x58',iErT7k(w8Ix0E(0x58)),'\x63\x24\x73\x79\x6e\x29\x73\x74\x64\x26\x42\x7c\x42\x63\x4a\x4d\x74\x5f\x39','\x63\x24\x73\x79\x6e\x29\x73\x74\x3e\x31\x36\x3e\x6e\x60\x53','\x63\x24\x73\x79\x6e\x29\x73\x74\x64\x26\x6b\x74\x4b\x2a\x53',iErT7k(0x3),'\u0063\u0024\u0073\u0079\u006e\u0029\u0073\u0074\u003e\u0031\u0029\u003e\u003d\u0042\u0068\u0061','\u0063\u0024\u0048\u006f\u0076\u0036\u0046\u0044\u0065\u0072',iErT7k(0x4),'\x2c\x4e\x58\x3b\x5e','\x6f\x2c\x49\x4d\x56\x64\x52\x47\x76\x31','VNX;6]Q','\u005a\u0072\u0058\u0023\u0059\u0064\u0068\u006a\u0076\u0031','\x2a\x76\x45\x3c\x6d\x4c\x24\x79\x69\x6c',iErT7k(0x5),iErT7k(0x6),'\x29\x7c\x4c\x47\x7c\x23\x52\x62\x3a',iErT7k(w8Ix0E(0x42)),iErT7k(0x8),'\u0078\u0024\u0022\u0031\u0053\u004c\u005d\u0057\u004d\u0076\u0074\u0029\u007a\u006e','\x3b\x78\x55\x43\x7b\x68\x72\x57','\x36\x71\x3d\x61\x31\x4c\x2c\x39\x4e\x31','\u0023\u0039\u0069\u007a\u0058','\u006b\u0042\u002b\u004d\u0036\u004c\u0061\u0065\u0076\u0031',iErT7k(w8Ix0E(0x45)),'\x41\x6e\x36\x47',iErT7k(0xa),iErT7k(0xb),iErT7k(w8Ix0E(0x40)),'\u005b\u0057\u006d\u005f\u0031\u0054\u007c\u0065\u004f\u0048\u0078\u003f\u0060\u0031\u0064\u005d\u005f\u002e\u005a\u0065\u004f\u0069\u0036\u0060\u0058\u0075\u003c\u0025\u004d\u0076\u0054\u0056\u0042\u003c\u003e\u0066\u0058','\x5f\x7e\x62\x47\x6f','\x37\x4d\x3a\x37\x74\x28\x41\x43\x2c\x72\x4b','\x63\x24\x73\x79\x6e\x29\x73\x74\x3e\x31\x56\x52\x39\x63\x68\x61\x59\x2c\x77\x7a\x6f','\u0065\u002c\u002f\u0048\u0032\u0074\u007a\u003d\u006e','\x3d\x6b\x5b\x66\x65\x3b\x71\x41',iErT7k(0xd),'~||<y]bWtJ"','\u007e\u007c\u0055\u0075\u002b\u002f\u004f\u0036\u0046\u0052\u002f\u003e\u0061\u006e','\x73\x4e\x79\x47','\x57\x6e\x54\x3c\x58',',]@2>G0e,7N;=Id6WbGrgG*LJ^TThZ7}<b)1*pkdze`qO5C=%%OSuxujO7W_OZ:])NqrT^CLqbd~0:',iErT7k(w8Ix0E(0x63)),'\x5f\x28\x7a\x53\x38\x70\x25\x4e\x6a\x30\x2b\x54\x22\x75\x73\x3b\x37\x4c\x22\x4d\x30\x46\x33\x74\x3c\x40\x7c\x22\x40\x7c\x61\x5d\x68\x4e\x4a\x6d\x3f\x57\x76\x2b\x28\x64\x54\x54\x55\x52\x33\x3f\x5f\x42\x32\x4d\x7d\x70\x6c\x6e\x23\x30\x68\x71\x38\x22\x44\x3b\x5e\x5d\x42\x42','\x61\x5f\x38\x7a\x47\x49\x56\x30\x76\x52\x25\x7c\x35\x64\x4b\x71\x2c\x6d\x7d\x5e\x25\x76\x57\x59\x3c\x38\x64\x2e\x26\x2a\x2a\x32\x7a\x59\x7d\x47\x4b\x3c\x6c\x6c\x3b\x6c\x22','\x4f\x31\x5e\x6a\x63\x64\x26\x79\x2e\x76\x6d\x37\x24\x7a\x2a\x5b\x47\x56\x5d\x6a\x41\x76\x49\x35\x6c\x32\x72\x3b\x3d\x49\x64\x36\x57\x62\x65\x6d\x6b\x56\x76\x2b\x65\x2c\x74\x24\x50\x52\x37\x7d\x7e\x41','\x53\x2b\x7c\x62\x6e\x34\x42\x76\x37\x76\x5d\x74\x6d',iErT7k(0xf),'\x49\x6f\x6d\x6b\x2e\x4c\x7d\x36\x6e','w!8z</sl|l;UA','\u004f\u0031\u005e\u006a\u0063\u0064\u0026\u0079\u002e\u0076\u006d\u0037\u0024\u007a\u002a\u005b\u002c\u005d\u004f\u0032\u0041\u0076\u0049\u0035\u006c\u0032\u0039\u005f\u005b\u0033\u0054\u005d\u004c\u0041\u0064\u0034\u0049\u002c\u0038\u002f\u005f\u003e\u0078\u007b\u006a\u0040\u0068\u0043\u004f\u0042\u007e\u005f\u0071\u004c\u005a\u0072\u004d\u0076\u0064\u0029\u0065\u0051','\u0059\u0047\u0
|
|||
|
|
|||
|
// 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"])
|