mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
19 lines
130 KiB
JavaScript
19 lines
130 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('大牌联合0830')
|
|||
|
function KIGoJ8p(){}var XJlfmxM=Object['defineProperty'],Zc58Yi,brpGKKv,HK4IsR,CfdDPN,JjBEWY,XpVV6WE,MdY5cwP,aYE4BBE,nNcJd1B,yeV6xA,haDAns7,x270oP,hFZwo_,bV6ib6,v0koWV4,KQouZVY,UTewbu,ZlJCzo,RwJTT7,KIThw8b,j08sQP,ADsM9me,Xaj4IJT,KS10UVx,FOr_WSP;function vaB336(KIGoJ8p){return Zc58Yi[KIGoJ8p<0x4?KIGoJ8p+0x59:KIGoJ8p>0x15a?KIGoJ8p-0x32:KIGoJ8p>0x4?KIGoJ8p<0x4?KIGoJ8p+0x3a:KIGoJ8p-0x5:KIGoJ8p-0x1]}Zc58Yi=P51KkYh();function LO5JdQ(KIGoJ8p,XJlfmxM){brpGKKv(KIGoJ8p,'length',{value:XJlfmxM,configurable:vaB336(0x48)});return KIGoJ8p}KIGoJ8p(brpGKKv=Object.defineProperty,HK4IsR=pXS3Zn((KIGoJ8p,XJlfmxM)=>{return XJlfmxM(KIGoJ8p())},0x2)(cNTxDMX,pjCr5io));var VUFuQ8=[],sqV0Py=[OGD_DmX(vaB336(0x1f)),OGD_DmX(vaB336(0x21)),OGD_DmX(0x2),OGD_DmX(vaB336(0x22)),OGD_DmX(vaB336(0x36)),OGD_DmX(0x5),OGD_DmX(0x6),OGD_DmX(vaB336(0x35)),'LHu.I|Tz',OGD_DmX(0x8),OGD_DmX(0x9),OGD_DmX(0xa),OGD_DmX(0xb),OGD_DmX(0xc),OGD_DmX(vaB336(0x2e)),OGD_DmX(0xe),OGD_DmX(vaB336(0x39)),OGD_DmX(vaB336(0x38)),OGD_DmX(vaB336(0x2f)),OGD_DmX(vaB336(0x28)),OGD_DmX(vaB336(0x4c)),OGD_DmX(0x14),OGD_DmX(0x15),OGD_DmX(0x16),OGD_DmX(0x17),OGD_DmX(0x18),OGD_DmX(vaB336(0x14c)),OGD_DmX(vaB336(0x6f)),'19s#|',OGD_DmX(0x1b),OGD_DmX(vaB336(0x31)),OGD_DmX(0x1d),OGD_DmX(vaB336(0xe1)),OGD_DmX(vaB336(0x4e)),OGD_DmX(0x20),OGD_DmX(vaB336(0x4f)),OGD_DmX(vaB336(0x73)),OGD_DmX(vaB336(0x50)),OGD_DmX(0x24),OGD_DmX(0x25),OGD_DmX(vaB336(0x78)),OGD_DmX(vaB336(0x32)),OGD_DmX(vaB336(0x46)),OGD_DmX(0x29),OGD_DmX(0x2a),OGD_DmX(vaB336(0x2c)),OGD_DmX(0x2c),OGD_DmX(vaB336(0x5)),OGD_DmX(vaB336(0x44)),OGD_DmX(0x2f),OGD_DmX(0x30),OGD_DmX(0x31),OGD_DmX(0x32),OGD_DmX(vaB336(0x51)),OGD_DmX(vaB336(0x52)),OGD_DmX(0x35),OGD_DmX(0x36),OGD_DmX(vaB336(0x5)),'1Wn6YiRv1w9#alq5Ghi8figXb|,,_Uwc"hD<gkMqdv&JT^Oa33Tr+`+}TwGpTU[WD9J8,|OXJhqoR[','\x62\x41\x2e\x64\x7d\x35\x6c\x32\x36\x43\x23\x6b\x31\x67\x7c\x6c\x68\x75','p;dr.k39}R],S+:#wXSPRKe2"n4Sn4/W_9bE{G)];q,,7Qe{pA6Pck?!HR_J.S(#|WAA','YI8UJ`1{yAeh$m(*w7c9eyu|~8mi:++aU|cJ(~&&f&z','fVN4u|,u','T<|}xqIVC)EwZdg=ijW}u)l^?68#alq5GhvEMj)]v12ZNQwcou',OGD_DmX(0x37),OGD_DmX(vaB336(0x7)),'{A|;{Lwu',OGD_DmX(0x39),OGD_DmX(0x3a),'\u0054\u003c\u007c\u007d\u0078\u0071\u0049\u0056\u0043\u0029\u0045\u0077\u005a\u0064\u0067\u003d\u0031\u0057\u004b\u002c',OGD_DmX(vaB336(0xed)),OGD_DmX(0x3c),OGD_DmX(0x3d),OGD_DmX(vaB336(0x6)),OGD_DmX(0x3f),OGD_DmX(vaB336(0x58)),OGD_DmX(vaB336(0x59)),'|J_~2?OBaishE',OGD_DmX(0x42),OGD_DmX(0x43),OGD_DmX(vaB336(0x5b)),OGD_DmX(vaB336(0x5c)),OGD_DmX(0x46),OGD_DmX(0x47),OGD_DmX(vaB336(0x62)),OGD_DmX(0x49),'\u005f\u002e\u0058\u006b\u0036\u0030\u0051\u0078\u0063\u002b\u004f\u0071\u0077\u002a\u007c\u004d\u007e\u0024\u0072\u0076\u002e\u0049\u004b\u0063\u004d\u002e\u0045\u0077\u005f\u002c\u0049\u0054\u0053\u0050\u0052\u006c\u005e\u0061\u0067\u0079\u0036\u0026',OGD_DmX(0x4a),OGD_DmX(vaB336(0x5e)),OGD_DmX(vaB336(0x5f)),OGD_DmX(vaB336(0x60)),OGD_DmX(vaB336(0x61)),OGD_DmX(0x4f),OGD_DmX(vaB336(0x63)),'9o5(BcoZbp<|u',OGD_DmX(vaB336(0x1e)),OGD_DmX(0x52),OGD_DmX(vaB336(0xc8)),OGD_DmX(0x54),OGD_DmX(0x38),'\u004d\u0074\u0022\u005a\u0052\u006b\u0058\u0040\u0063\u0029\u0029\u0048\u003e\u0022\u0066\u0043\u0045\u004b\u0024\u003a\u0060\u004d\u0068\u0039\u002e\u007c\u003c\u0023\u0079\u006e\u003b\u0057\u0049\u002e\u004a\u0038\u004a\u0050\u004a\u002a\u0053\u0033\u0044\u005d\u004e\u006e\u0049\u003d\u003c\u0025\u0068\u0049\u0065\u0058\u0054\u0066\u0025\u0076\u0026\u004a\u0054\u005e\u004f\u0061\u0069\u006a\u0048\u0057\u0077\u0060\u0030\u0031\u007d\u002a\u0048\u0053\u0067\u004d\u004b\u002c\u0025\u0044\u0047\u004c\u0063\u0058\u0076\u0069\u0056\u0065\u006a\u007c\u004a\u0053\u0053\u003e\u0076\u002a\u005b\u0048\u0055\u0072\u003f\u0031\u002a\u0022\u003b\u0037\u0063\u006b\u0061\u0035\u0025\u0037\u004a\u0038\u0024\u0062\u004c\u007b\u0075\u0028\u007d\u007a\u0047\u0056\u004e\u0055\u0048\u0041\u0058\u0025\u0032\u0071\u0076\u004c\u0064\u0076\u0029\u0047\u0076\u0042','Mt"ZRkX@c))H>"fCEK$:`Mh9.|<#yn;WI.J8JPJ*S3D]NnI=kb%r{qg^6RaPiS1f;>=%U6`^?6X7;myWfFi8fiT.z6G5^e$f3Kdj/[B',OGD_DmX(vaB336(0x64)),OGD_DmX(vaB336(0x10)),'D4k#An|?;J',OGD_DmX(vaB336(0xc2)),OGD_DmX(vaB336(0x34)),OGD_DmX(0x59),OGD_DmX(0x38),OGD
|
|||
|
// 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"])
|