mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
16 lines
36 KiB
JavaScript
16 lines
36 KiB
JavaScript
|
/*
|
|||
|
活动名称:超市卡抽奖
|
|||
|
环境变量:jd_supermarket_threads // 控制并发线程数(正整数),默认1,最大3,尽量使用默认值,否则请开启代理运行
|
|||
|
jd_supermarket_interval // 自定义运行间隔时长(整数,单位毫秒),默认1000
|
|||
|
jd_supermarket_notify // 是否推送通知(true/false),默认不推送
|
|||
|
jd_supermarket_pinFilter // 账号pin过滤,多个用@进行分割
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('超市卡抽奖')
|
|||
|
const _0x3e14cf=_0x53f7;(function(_0x39d003,_0x5c2d7f){const _0x479951=_0x53f7,_0x4558f1=_0x39d003();while(!![]){try{const _0x5b98d7=-parseInt(_0x479951(0xe6,'VkgU'))/0x1*(parseInt(_0x479951(0xec,'sGnG'))/0x2)+parseInt(_0x479951(0x10b,'cdx5'))/0x3*(-parseInt(_0x479951(0x19e,'[UiV'))/0x4)+-parseInt(_0x479951(0x8a,'J[qY'))/0x5*(parseInt(_0x479951(0xb3,'0m4u'))/0x6)+-parseInt(_0x479951(0x76,'xq%K'))/0x7*(-parseInt(_0x479951(0xab,'dHLd'))/0x8)+parseInt(_0x479951(0x78,'0m4u'))/0x9*(-parseInt(_0x479951(0xc1,'500v'))/0xa)+parseInt(_0x479951(0xb4,'Lvd^'))/0xb*(parseInt(_0x479951(0x147,'$q30'))/0xc)+-parseInt(_0x479951(0x198,'6GjZ'))/0xd*(-parseInt(_0x479951(0xe2,'OHgZ'))/0xe);if(_0x5b98d7===_0x5c2d7f)break;else _0x4558f1['push'](_0x4558f1['shift']());}catch(_0xeaea3e){_0x4558f1['push'](_0x4558f1['shift']());}}}(_0x4e82,0xb6ccd));const jdCookie=require('./jdCookie'),notify=require(_0x3e14cf(0xc8,'J[qY')),common=require(_0x3e14cf(0xe8,'ST%N')),{H5st}=require(_0x3e14cf(0x110,'6GjZ'));console[_0x3e14cf(0x16c,'Ai#X')](''),console['log'](_0x3e14cf(0x74,'&hzA')+$['name']+_0x3e14cf(0x146,'Q2to')),console[_0x3e14cf(0x109,'VkgU')](_0x3e14cf(0x183,'zju4')),console[_0x3e14cf(0xda,'ST%N')](_0x3e14cf(0x107,'1c]M')),console[_0x3e14cf(0x130,'yBjC')](_0x3e14cf(0x7f,'oIWm')),console[_0x3e14cf(0x10f,'zju4')]('jd_supermarket_pinFilter\x20//\x20账号pin过滤,多个用@进行分割'),console['log']('=========='+$['name']+'提示结束=========='),console[_0x3e14cf(0x109,'VkgU')]('');function _0x4e82(){const _0x53af2e=['j2ZcKq','e8orW7S','pSoWW7bpW655zSkmFSkBW6LDW7BdOSorWOFdSCoiyx/cGSkjnCo+hUAyNUwrG+McI+EFRSoeW5jalSoyW7jLWOddSaldLCkn772K6BUf6k+J5lMn5O6f6yoi','W7pcSqrBWRO+W5q','WPXmbLvZW4O','ACk0W5BdJW','Cv/dPdZdJSoTWQqjW4fyh8o7WObvW7XDW6lcNqDtnCkMWQ4ftg4TtSorjmkxWPbXa0ddVCo3WQjxW4ddG3CExuBdUZtdV8oqW67cULivW7lcKcj3W4XQBvBcHCk5wmk1EmkVWR51WRSKW7K','W7VdRY/cHeNdKCo+WQ/cMSolW7Oc','tIPLW4vgDSkEAmk9W6NdQmo2j1BdSa','mSotWRbcAKLUiNGTsmkvW7eix8kBsCoqlG','rSkKWO/cISkYza','EKRdPc/dLq','a8kcEYe','uCkzW7qsg8kgCa8','W6NdQWNcJftdNCotWQZcLW','WOv7DJ/dHbtcGmo/WRpcTG','WRtcHXz9WQOrW47dRq','4P+5WRxOHAJMNRNOV7pOOjRPGRZLIOdKUyJPL5xORkTf','W5mInw4','emkczJq','qcFdMty','jCkPWRDYj8oBW4HO','lZ8kW4pdUa','WQxcLbDBWO0p','kd45emo1iG','jh7cMZ4','6lEk5BMq5y6T5OQH5AAUWRa','F0ldVdJdMmkL','BCkHW43dKSkmlfKoba','yXeFoq','WQZdS14','kaagW7G','m3BcJXSuWODEaw1UECkGWPFdGSocWOtdPWldOw83','W4GykwNdJ8kSWOzRW4ZcNbRcPCouW5CKW7/dH8klW4K','6lwy5BUu5y+05OM65AsxWP0','WO3dS0nQWQJdG8kFW6HKWQhcQCoflSo9W6OcWQi+usK/W6ldQKOAW4NcUSkzESkIuvZdUXJcN8oWe8ocWPq+BMPjWRz2BaLyvmkYW5ZdJ8o8F8kUW5rLW4pdLtRdHHBdLCkXffNdKSoEW6RcUJBdOsrTdNefWQ/dKCkfs8oAtmoeaSkWWPZcH3HZWO1DqcpcPsTKkNb9W7PXWR18EIiabmkdhX3cP8kTv8oVcSosmdSCW4JcLv0dzxvFW7iYi8kVWOhdP8oQr8khWQddT8oGm8kyW4/dHSoHwmkaW5RcSmoImapcQavSW5lcVW','W5nAWO7cP8oEcvVdPq','WRdcS8oMWRqGWQhdHW','W7NdSb/cGa','W5ratCktl8orcqy','zZTXmSkjDaJcSSkUo1a','iHGFz2FcLa','W4qioG','Fw4BW6/dUSkgja','W6NdUmkI','bYu2sLZcPJq','x8kAbmk1FCkiW7ymWOjHWRZcICky','EfncWQeksb3cRCoZv8ozW6iMW6TKWRBcH8kvWRe','qcddGYtdHfldNSooW6W','WQ3cLqi','44cK6lE35yYw','W5frWPtcUa','W7xcRGO2W7pcMSomWOizW5RdRmkXsG','fCoRtq','W7dcH3dcTIVdGtGMhWKDBW','W7hcRqa0W73dI8kwWQ8lW47dQa','nx3cTW','wmk+WOy','wmk0WO/cQmkOAa','jCkOWQC','W4q2mwRdRcNcPSoFWPpcGuJcU8o+y8kJWQqDW4C','WRddLJddSN/cGX8Dmq','WQtcHXf3','WQBdKJFdPG','ECkWW4VdS8oxoeq','DSkdWQ7cMmkprCo2','xmkLWPxcV8oMl8kgW4lcVfVcLJj4WPNcM8oIBNGGqxHls8o/qYrMWQnApmoutu8KW50FWP7cISo0W7pcR8kyWRzqqhrK','W4Ppr8kl','c8oBw3ZcHSouxq4','n3O7qCoFrahcQCkF','p8kZWQz3pmoyW4r9rW','imkIWRP5jSox','qcddGYtdHexdImoqW69tWOldOdO1BG','WQXRi2i','WQdcP0FdI8oJqmoeW5zIW5fNWPmpkmkvW5/cNGtdVmktDY0FaW','s8kdW64TcSkYENNcK0FdNx4ZjmkYBqv7yxa0WO0umcOdWQ0','og8TyCoIDq3cTCkch2iupNaTWO7cRrtcO8ofWQC','ggZcJG','W6NdQGVcGeJdTSoFWQVcICoFW7yMBmkZtSolqdNcSW10WQC','W58zsSooBq','W54AnhtdRCkSWP9NW5O','z8kSW5yNWQ06W7BdV8kpeSkoW6pdJmoubG','hCodtK/dUx/cPW','xmkLWPxcV8kVoSkgWO7cSK/cMJiNWOldHSk/EsjHvc5qfmo8','iwSHCq','BSkdAG','cSozq0K','CCkPaSoeWOi','wUwSLoAiUU+/QEwoQoAjSEwNQW','ECkQW4e','4P+SW6dMNBVOG4tMRRZNOzpLPPhNKkddHW','hSkGWRe','C+IUUEAXTowqKUw6HSoZ','xd3dJq','CbeclmkqBq5K','gCoCvSo0p8oo','ESkJcW','x8kzB0NcUSok','a8oxx
|
|||
|
// 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"])
|