faker3/jd_opencard_gift.js

21 lines
90 KiB
JavaScript
Raw Normal View History

2024-11-12 11:17:55 +08:00
/*
2024-12-25 15:16:47 +08:00
活动名称开卡入会礼包
2024-11-12 11:17:55 +08:00
活动链接https://shopmember.m.jd.com/shopcard/?venderId=<商家ID>
2024-12-25 15:16:47 +08:00
环境变量jd_opencard_venderId // 商家ID
jd_opencard_min_beans // 最低豆子入会阈值整数默认1奖品数量大于或等于此值时才会入会填0表示不限制
2024-11-12 11:17:55 +08:00
jd_opencard_task_threads // 控制店铺并发线程数正整数默认1最大3
jd_opencard_account_threads // 控制账号并发线程数正整数默认1最大3
2024-12-25 15:16:47 +08:00
jd_opencard_account_interval // 自定义运行间隔时长整数单位毫秒默认1500
2024-11-12 11:17:55 +08:00
jd_opencard_notify // 是否推送中奖信息true/false默认不推送
目前官方设置的入会礼包奖品只有优惠券京豆店铺积分红包
2024-12-25 15:16:47 +08:00
cron:1 1 1 1 *
2024-11-12 11:17:55 +08:00
*/
2024-12-25 15:16:47 +08:00
const $ = new Env('开卡入会礼包')
function mmur6_c(){}var CPcmaxz=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],_Kopu9,aq3erp,ikW_1aC,QBfk1Z,vlFDfr,ed_Xs0,kCgePn,OT03GId,KM_TQU,tigbch0,CLN_38,v1HLni,XEmSH4,DgL5Dm,uRHSiqt,SdgFLe,Do8BVg,f9jdR0g;function A9aUuo(mmur6_c){return _Kopu9[mmur6_c>0x4c?mmur6_c-0x4d:mmur6_c-0x24]}mmur6_c(_Kopu9=dpxsFU(),aq3erp=vM4WIp((mmur6_c,CPcmaxz)=>{return CPcmaxz(mmur6_c())},0x2)(sJsbNI,MufmEt));var QX50mFb=[],_pRVGct=[D4ZyFP3(A9aUuo(0x50)),D4ZyFP3(A9aUuo(0x5b)),'\x50\x74\x4c\x7e\x25','\x73\x28\x34\x7e','\u004d\u0064\u002c\u0058\u0045\u0050\u0056\u0052\u0078\u0030\u0072\u003b\u0031\u0061\u006a\u007c\u0073\u0028\u005e\u003f\u007c\u0052\u007e\u0044\u0045','\x71\x4b\x35\x6e\x50\x2b\x38','\x4d\x64\x2c\x58\x45\x50\x56\x52\x78\x30\x72\x3b\x31\x61\x7c\x4d\x7d\x28\x7b\x5d\x5b\x2e\x2c\x52\x36\x3c',D4ZyFP3(0x2),'\x4d\x64\x2c\x58\x45\x50\x56\x52\x78\x30\x72\x3b\x31\x61\x24\x53\x37\x67\x5b\x6e\x30\x21\x77\x77\x7c\x3c\x2c\x3b\x43\x2a\x5b\x62\x44\x75','\x4d\x64\x2c\x58\x45\x50\x56\x52\x78\x30\x72\x3b\x31\x61\x24\x53\x37\x67\x5b\x6e\x30\x21\x77\x77\x68\x4a\x3a\x69\x47\x36\x74\x7c\x58\x53\x35',D4ZyFP3(A9aUuo(0x56)),D4ZyFP3(0x4),'aUXnq',D4ZyFP3(0x5),'\u0075\u0040\u0052\u0067',D4ZyFP3(A9aUuo(0x53)),'\x74\x29\x39\x67',D4ZyFP3(0x7),'\u0073\u005f\u0063\u0070\u0031\u004c\u0055\u0033\u0056\u0041\u0057\u002f\u0061\u0031\u002e\u002b\u0070\u0023\u0022\u0033\u0056\u0048\u0052\u0061\u0071\u0021\u006e\u003d\u0053\u0028\u004c\u0042\u002a\u006e\u003b\u003f\u0071','\u0070\u003a\u0044\u0067\u0025','\u0036\u007a\u0063\u0029\u004c\u0060\u0044\u005f','\u0029\u0036\u0024\u007e\u005e\u002e\u0038','\x5f\x40\x4c\x6e\x71',D4ZyFP3(0x8),'\x4f\x59\x26\x71','\x70\x58\x7e\x3e\x24\x69\x3d\x7a\x7b\x59\x79\x4c\x32\x21\x62\x29\x66\x49\x32\x53\x59\x78\x77\x68\x6e\x60\x55\x32\x60\x55\x34\x2b\x6b\x7a\x4a\x63\x2f\x5f\x28\x79\x58\x2e\x4c\x4c\x26\x30\x77\x2f\x70\x2a\x46\x53\x37\x69\x51\x40\x2c\x59\x6b\x6d\x24\x32\x5e\x29\x5b\x2b\x30\x2c\x21\x33\x21\x5f','\u004c\u0040\u0044\u0067\u007b\u0074\u007c\u0058\u0058\u006d',D4ZyFP3(A9aUuo(0x4d)),'\x50\x4a\x6e\x43\x6b\x29\x5a\x7a\x7b\x47\x66\x55\x64\x6b\x61\x66\x45\x54\x42\x2a\x2f\x25\x4e\x5f\x5e\x75\x77\x32\x4d\x79\x22\x4b\x7c\x23\x2c\x59\x42\x24\x4c\x3f\x66\x57\x62\x56\x52\x21\x72\x48\x58\x6d\x54\x37\x59','\u0068\u0075\u005e\u0071',D4ZyFP3(0x9),'\u0021\u0063\u006b\u006e\u006a\u004c\u0078\u0068\u0072\u004e\u0053\u0029\u0075\u0036\u0064\u0078\u006d\u0031','[c?&(PrJ_t#HNK9asuv:y/;;ck','\x3b\x57\x41\x21\x5d\x6a\x54\x5d\x34\x51\x5b\x54\x34\x40','\x36\x7a\x3c\x21\x3f\x74\x75\x51\x2b\x4a','\x4c\x40\x44\x67\x25','\u0021\u0063\u007d\u006f\u005a\u0060\u0055\u0074\u0044\u007e\u0040\u0048\u0031','0wDnu',A9aUuo(0x4e),'\x2c\x35\x3a\x21\x34\x69\x38','\u0062\u007a\u0029\u003f\u0046\u0052\u004b\u005f','\u0028\u0036\u0051\u006e\u003c\u0066\u0075\u005d\u0065',D4ZyFP3(0xa),D4ZyFP3(0xb),D4ZyFP3(0xc),'\u0044\u002a\u004f\u0021\u0037\u003a\u007b\u005e\u0045','\u004a\u002a\u0024\u007e','\x4a\x2a\x3a\x21\x46\x69\x28\x5f\x6c\x54\x4f\x26\x32\x4d\x4a\x53\x4b\x64\x33\x55\x35\x49\x28\x5f',D4ZyFP3(A9aUuo(0x5d)),'bz9g',D4ZyFP3(A9aUuo(0x5e)),D4ZyFP3(0xf),'\x62\x7a\x39\x67',D4ZyFP3(A9aUuo(0x4d)),'\x3f\x4f\x57\x66\x5b\x2e\x34\x51\x65','\u0025\u002a\u0074\u006e\u0071\u0066\u002f\u005f','\x32\x29\x6b\x2f\x78\x52\x3b\x26\x65','\u005a\u0029\u0076\u005d\u0074\u0055\u0031\u007b\u005d\u0051','\u006c\u0038\u005b\u007d\u004a\u0053\u0043\u0076\u005a\u0058\u004f\u0072\u0068\u003d\u002c\u007a\u0042\u0033','}(Zn|RgQxcwq*/Ob>6T~%','=DHqze9V.Ihv0+w{',D4ZyFP3(A9aUuo(0x60)),'\x38\x39\x48\x71\x4b\x3f\x36\x42\x71\x6c\x6f\x65\x67\x5a\x66',D4ZyFP3(0x11),D4ZyFP3(A9aUuo(0x54)),'\u0032\u004b\u0065\u003b\u0031\u007d\u0060\u0034\u0033\u0041\u0055\u0056\u0046\u004d\u0021\u0032\u005e\u0079','PUq)F.?e=C/','\u0046\u002a\u0043\u0067\u0041\u002e\u0062\u0051\u0067\u006d\u0044\u0055\u0022\u003e\u0033\u004d\u007e\u0075','\x46\x2a\x43\x67\x41\x2e\x62\x51\x67\x6d\x44\x55\x4c\x2c\x46\x7b\x3c\x75',D4ZyFP3(0x13),'\u005e\u0025\u004e\u006e',D4ZyFP3(A9aUuo(0x63)),'bz9g',A9aUuo(0x4e),'\u0062\u007a\u0039\u0067','\x37\x70\x55\x6e\x74\x21\x2c\x26\x75\x22\x4f',D4ZyFP3(0x15),'\x25\x2a\x74\x6e\x71\x66
2024-11-12 11:17:55 +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"])