faker3/jd_opencard_gift.js

21 lines
80 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
2024-08-28 11:13:58 +08:00
活动名称开卡入会礼包
2024-06-28 15:38:28 +08:00
活动链接https://shopmember.m.jd.com/shopcard/?venderId=<商家ID>
2024-08-28 11:13:58 +08:00
环境变量jd_opencard_venderId // 商家ID
jd_opencard_min_beans // 最低豆子入会阈值整数默认1奖品数量大于或等于此值时才会入会填0表示不限制
2024-06-28 15:38:28 +08:00
jd_opencard_task_threads // 控制店铺并发线程数正整数默认1最大3
jd_opencard_account_threads // 控制账号并发线程数正整数默认1最大3
2024-08-28 11:13:58 +08:00
jd_opencard_account_interval // 自定义运行间隔时长整数单位毫秒默认1500
2024-06-28 15:38:28 +08:00
jd_opencard_notify // 是否推送中奖信息true/false默认不推送
目前官方设置的入会礼包奖品只有优惠券京豆店铺积分红包
2024-08-28 11:13:58 +08:00
cron:1 1 1 1 *
2024-06-28 15:38:28 +08:00
*/
2024-08-28 11:13:58 +08:00
const $ = new Env('开卡入会礼包')
function IX4zKiN(){}var _WAQ0w=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],YQv5IM,gVMsql,V3fJvZ,noFMgTK,EpRUAtk,j7nlO_,FBrmvt,Yt26BO,DT8RSX,WE8GFjz,ikmn8sl,slaNz8,rlhlDvG,wPghFV,XiGw4m,tYPvnvU,MtnecMJ,QuzJpL5;function _eHlUj(IX4zKiN){return YQv5IM[IX4zKiN>0xac?IX4zKiN+0x58:IX4zKiN+0x14]}YQv5IM=h8sfJvu();function py0zf0(IX4zKiN,_WAQ0w){return gVMsql(IX4zKiN,'\x6c\x65\x6e\x67\x74\x68',{value:_WAQ0w,configurable:_eHlUj(0x3b)})}IX4zKiN(gVMsql=Object.defineProperty,V3fJvZ=py0zf0(vd3yK_q((..._WAQ0w)=>{var gVMsql=vd3yK_q(_WAQ0w=>{return YQv5IM[_WAQ0w>0xd1?_WAQ0w+0x37:_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bU(0x30),vrU4bU(0x31),vrU4bU(0x1a),vrU4bU(_eHlUj(-0xd)),vrU4bU(_eHlUj(-0xc)),vrU4bU(0x34),'mqLv|Vrz7$Uf(^mF2RD;8wrz',vrU4bU(_eHlUj(0xa7)),vrU4bU(0x35),vrU4bU(0x36),vrU4bU(_eHlUj(-0x2)),vrU4bU(0x1c),vrU4bU(_eHlUj(-0xf)),'h+EZDX%*|mHf6@9N5:',vrU4bU(0x1c),vrU4bU(_eHlUj(-0x12)),vrU4bU(0x39),vrU4bU(0x3a),vrU4bU(0x3b),vrU4bU(_eHlUj(0x31)),vrU4bU(_eHlUj(0x65)),vrU4bU(0x3e),'@r0~O!Zte,+$|wqJ','2Z0~I1%*|G8;:',vrU4bU(0x3f),vrU4bU(0x40),'3q&v||U',vrU4bU(_eHlUj(0xaa)),vrU4bU(0x42),'\x33\x3b\x49\x70\x7c\x57\x65\x66\x57\x45\x6a',vrU4bU(0x43),'`]EH+g#|V{oBhr,`*C',_eHlUj(-0x11),vrU4bU(0x44),vrU4bU(0x45),'\u007c\u0071\u0045\u005a\u0062\u0057\u004e\u0074\u005a\u0043\u002a\u003b\u0061\u0023\u007c\u0068\u004b\u003a',vrU4bU(0x46),vrU4bU(0x1c),vrU4bU(_eHlUj(0x52)),vrU4bU(0x48),vrU4bU(0x49),vrU4bU(0x4a),vrU4bU(_eHlUj(0x37)),vrU4bU(0x1c),vrU4bU(0x1c),vrU4bU(_eHlUj(-0xe)),'mqLv|Vrz',vrU4bU(0x4d),vrU4bU(0x4e),vrU4bU(0x4f),vrU4bU(0x3a),vrU4bU(_eHlUj(0x38)),vrU4bU(0x51),'3;Ip|WefWEj',vrU4bU(_eHlUj(-0x9)),vrU4bU(0x53),vrU4bU(0x54),vrU4bU(_eHlUj(0x3d)),vrU4bU(_eHlUj(0x3c)),_eHlUj(-0x11),vrU4bU(_eHlUj(0x35)),'\x33\x3b\x49\x70\x7c\x57\x79\x6b\x59\x45\x6a',vrU4bU(0x1b),vrU4bU(0x1c),_eHlUj(-0x10),vrU4bU(0x1c),vrU4bU(0x1c),'\u0077\u0078\u004d\u004a\u0055\u006b\u003d\u0079\u0053\u0062\u0077\u0028\u0044\u004a\u0044\u007d\u0046\u006d\u006e\u0075\u005f\u0060\u0032\u002f\u0064\u0076\u0050\u0067\u0065\u0063\u0026\u006a\u0067\u0071\u007c\u0046\u0050\u0056\u0053\u0079\u005a',vrU4bU(0x57),vrU4bU(_eHlUj(-0x12)),vrU4bU(0x1c),vrU4bU(0x1c),'h+EZDX%*|mHf6@9N5:',vrU4bU(_eHlUj(0x9)),vrU4bU(0x53),vrU4bU(_eHlUj(-0x12)),_eHlUj(-0x10),vrU4bU(0x1c),vrU4bU(_eHlUj(-0x12)),vrU4bU(0x59),vrU4bU(_eHlUj(-0xf)),vrU4bU(_eHlUj(-0x12)),vrU4bU(_eHlUj(0x4a)),vrU4bU(0x5b),vrU4bU(0x5c),vrU4bU(0x5d),vrU4bU(0x5e),vrU4bU(_eHlUj(0x4d)),'T5wZ7=|<bc!TOUj|^R#<46hz',vrU4bU(_eHlUj(0xa1)),'vFTyxvbh%C|wh1<^',':r^@!|M',vrU4bU(0x61),vrU4bU(0x62),'\u007c\u0071\u0045\u005a\u0062\u0057\u0032\u007a','AA?|M3<:',vrU4bU(0x63),vrU4bU(0x64),vrU4bU(0x65),'Iq1`9xZtxKdx|?q','\x68\x2b\x2a\x7c\x50\x54\x4d',vrU4bU(0x66),'|qfv]%t}"',vrU4bU(0x67),vrU4bU(_eHlUj(0x25)),vrU4bU(_eHlUj(0x2f)),vrU4bU(0x6a),vrU4bU(_eHlUj(0x53)),vrU4bU(0x6c),vrU4bU(0x6d),vrU4bU(0x6e),vrU4bU(0x6f),vrU4bU(0x70),vrU4bU(0x71),vrU4bU(_eHlUj(0x54)),vrU4bU(0x73),vrU4bU(_eHlUj(0x56)),'\x2e\x7c\x4e\x47\x7e\x6f\x7c\x59',vrU4bU(0x75),vrU4bU(0x76),vrU4bU(0x77),vrU4bU(_eHlUj(0x57)
2024-06-28 15:38:28 +08:00
// 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"])