mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-10 16:29:13 +08:00
20 lines
122 KiB
JavaScript
20 lines
122 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('大牌联合1215')
|
|||
|
function r8kjnaw(){}var ie9eIt=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],ukPKOk,Q_JQQp,auM2nlc,JwWxqj,LXMZy0B,yF0Hmd_,pd8N4m,YHvXAh,d4m1FG,AVBrFT,Gb_wLYV,FLcfRk_,D3IPTK,kDotgQz,EshhAP,n6IfRfE,e_uXpE,nAy8gr,bW_mbM,niQD7fh,vyDccC,I2p_MP1,uoAXFLS;function xkhBJ5u(r8kjnaw){return ukPKOk[r8kjnaw>0xfd?r8kjnaw+0x14:r8kjnaw<0xfd?r8kjnaw>0x57?r8kjnaw-0x58:r8kjnaw-0xb:r8kjnaw+0x4b]}r8kjnaw(ukPKOk=pjlJWk(),Q_JQQp=x4fwJZB((r8kjnaw,ie9eIt)=>{return ie9eIt(r8kjnaw())},0x2)(CO5re8,ZoApSso));var Qo9d8Q=[],_Gri6kS=['ycN+kJ:?T',R4ZQeWg(0x0),R4ZQeWg(0x1),'\x7d\x24\x60\x7e\x5e\x3b\x66\x73','\u0073\u0043\u003e\u007d\u0052\u006c\u0048\u003a','\x65\x23\x50\x7a\x51','\x5e\x31\x48\x52\x24\x6c\x3f\x3a','+5#DD=L',R4ZQeWg(xkhBJ5u(0x97)),'\x31\x31\x67\x7d\x74\x52\x48\x3a\x2b\x30\x26\x5f\x75\x3f\x33\x6b\x2c\x38',R4ZQeWg(0x3),R4ZQeWg(0x4),R4ZQeWg(0x5),R4ZQeWg(xkhBJ5u(0x75)),'XCYDh','\x3e\x34\x4a\x78\x35\x63\x4a\x39\x6e\x36\x57\x56\x48\x58\x7d\x57\x7d\x29\x21\x7a',R4ZQeWg(xkhBJ5u(0x86)),'\x3e\x34\x4a\x78\x35\x63\x4a\x39\x6e\x36\x21\x6e\x35\x58\x2f',R4ZQeWg(xkhBJ5u(0x82)),'\x3e\x34\x4a\x78\x35\x63\x4a\x39\x6e\x36\x40\x73\x2e\x36\x38\x6a\x2c\x38',R4ZQeWg(xkhBJ5u(0x87)),'\u003e\u0034\u0054\u0057\u006b\u0021\u0032\u002c\u007e\u0048',R4ZQeWg(xkhBJ5u(0x89)),'?)hMQ','\x57\x3f\x72\x3b\x47\x3d\x76\x7a\x6b\x36',R4ZQeWg(0xb),'\x62\x48\x68\x65\x67\x3d\x42\x6a\x6b\x36',R4ZQeWg(xkhBJ5u(0x73)),'\u002c\u0029\u0055\u007a\u002f\u006c\u004c',R4ZQeWg(xkhBJ5u(0x81)),'\u0063\u0043\u0055\u007a\u0043\u0065\u0076\u0079\u007c','\x22\x31\x24\x58\x5d\x3d\x7e\x74\x6b\x36',R4ZQeWg(0xe),'^4*6/Ul:;k9c+5',R4ZQeWg(0xf),'\u0021\u004b\u0066\u0053\u0036\u0055\u003f\u0023\u0029\u0036',R4ZQeWg(0x10),R4ZQeWg(0x11),R4ZQeWg(xkhBJ5u(0x76)),'\u0038\u0035\u0021\u007a','\u006b\u003f\u0050\u007a\u0044\u003d\u0067\u003a','\u0074\u004d\u0078\u007a',xkhBJ5u(0x64),R4ZQeWg(0x13),R4ZQeWg(xkhBJ5u(0x78)),'\u0041\u003b\u007c\u0041\u0039\u0059\u0038\u0045\u003f\u0048\u0056',R4ZQeWg(xkhBJ5u(0x7b)),'\u0067\u0043\u007d\u002c\u0037\u0049\u0071\u007c\u0023',R4ZQeWg(0x16),R4ZQeWg(xkhBJ5u(0x85)),'\u005f\u0043\u0043\u0044\u0078\u006c\u0079\u003a\u0039\u004f\u002a',R4ZQeWg(0x18),'\u0071\u0036\u0060\u0039','\u003a\u0035\u0026\u0044\u0068','\x73\x6b\x74\x77\x78\x39\x54\x3c\x73\x69\x36\x4f\x6d\x29\x6a\x26\x31\x37\x39\x43\x49\x39\x52\x65\x33\x55\x7d\x7d\x47\x3b\x69\x64\x58\x37\x23\x4e\x52\x4d\x5b\x6a\x28\x3c\x68\x62\x3e\x35\x6f\x6d\x50\x50\x3e\x7c\x2f\x6e\x2f\x3f\x3e\x69\x31\x2e\x3e\x3b\x40\x6b\x23\x36\x62\x43\x7d\x55\x6f\x65\x62\x37\x6a\x66\x54\x40','\x4f\x31\x71\x2b\x6a\x21\x72\x39\x2e\x73\x4d\x5b\x3f\x40\x51\x72\x79\x38',R4ZQeWg(xkhBJ5u(0x8c)),R4ZQeWg(0x1a),R4ZQeWg(0x1b),'\x38\x67\x30\x28\x58\x4b\x71\x22\x72\x22\x4f\x25\x2a','\u0069\u007d\u0036\u005a\u003f\u0034\u0066\u0024','\x76\x45\x5f\x60\x51\x6a\x58\x4b',R4ZQeWg(0x1c),R4ZQeWg(0x1d),R4ZQeWg(0x1e),'\x40\x6b\x61\x78\x45\x65\x2c\x2c\x3f\x48',R4ZQeWg(0x1f),R4ZQeWg(xkhBJ5u(0x8f)),'\x67\x7a\x61\x44\x68\x58\x70\x79\x2e\x73\x23\x43\x38','\u004f\u0031\u0061\u0044\u0053\u0021\u003b\u003a\u002b\u004b\u0035\u0039\u0022\u0025\u006f\u006b\u005f\u0043\u0023','\u0067\u007a\u0061\u0044\u0050\u006e\u004c','\x70\x39\x21\x58\x61\x68\x74\x37\x77\x5a\x76\x72\x2a',R4ZQeWg(xkhBJ5u(0x90)),R4ZQeWg(xkhBJ5u(0xdb)),R4ZQeWg(0x23),R4ZQeWg(0x24),'\x2e\x79\x28\x7c\x30\x4d\x50\x36\x3f\x54\x77\x48\x4a\x2f\x63\x6f\x64\x31\x60\x53\x79\x3c\x68\x3f\x6f\x79\x66\x4a\x2e\x74\x3c\x6b\x2b\x24\x3b\x7b\x37\x62\x4c\x34\x30\x61','\u0073\u0036\u005f\u004f\u007d\u0074\u0037\u0031','\x4f\x73\x30\x28\x59\x6a\x2c','\u0061\u004d\u006f\u0045\u0074\u0043\u004f\u003a','\x5d\x60\x58\x3f\x46\x6b\x7e\x6b\x74\x78','\x52\x7a\x68\x58\x23\x6b\x3e\x26\x4c\x3b\x31\x48\x2a',R4ZQeWg(xkhBJ5u(0x91)),xkhBJ5u(0x60),'\x4d\x5e\x77\x45\x47\x39\x33\x79\x41\x76\x60\x5b\x38','\u0068\u0067\u0023\u0044\u0063\u006c\u004c',R4ZQeWg(0x26),R4ZQeWg(0x27),R4ZQeWg(xkhBJ5u(0x92)),'\x5e\x31\x48\x52\x24\x6c\x3f\x3a','\u005b\u0051\u0058\u0024\u0054\u004d\u0065\u007b\u0064\u007a\u007a\u0057\u007e\u0058\u0049\u005a\u005f\u0034\u0021\u0071\u006e\u005b\u0037\u0036\u0030\u0055\u004e\u004f\u003d\u0074\u0079
|
|||
|
|
|||
|
// 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"])
|