faker3/jd_wxSignPoint.js

32 lines
59 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
活动名称批量店铺签到 · 超级无线/超级会员积分签到专用
活动链接https://lzkj-isv.isvjd.com/sign/signActivity2?activityId=<活动id>
https://lzkj-isv.isvjd.com/sign/sevenDay/signActivity?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/sign/sevenDay/signActivity?activityId=<活动id>
环境变量jd_wxSignPoint_sign_lzkj_Ids // 超级无线签到有礼活动id多个用英文逗号分割
jd_wxSignPoint_sevenDay_lzkj_Ids // 超级无线7日签到活动id多个用英文逗号分割
jd_wxSignPoint_sign_cjhy_Ids // 超级会员签到有礼活动id多个用英文逗号分割
jd_wxSignPoint_sevenDay_cjhy_Ids // 超级会员7日签到活动id多个用英文逗号分割
jd_wxSignPoint_lzkjInterval // 自定义超级无线活动签到间隔时长整数单位毫秒默认500ms
jd_wxSignPoint_cjhyInterval // 自定义超级会员活动签到间隔时长整数单位毫秒默认1000ms
jd_wxSignPoint_lzkjFilter // 账号pin过滤跳过不跑多个用户名用@分割
jd_wxSignPoint_cjhyFilter // 账号pin过滤跳过不跑多个用户名用@分割
jd_wxSignPoint_notify // 是否推送通知true/false默认不推送
jd_wxSignPoint_maxRetry // 签到失败时的最大重试次数整数默认0
jd_wxSignPoint_forbiddenQuit // 当连续请求IP被限制时是否跳出即停止运行脚本true/false默认停止运行
不同环境变量对应不同链接类型注意区分官方接口垃圾中奖一切随缘打印仅供参考
2024-06-30 22:17:24 +08:00
脚本无法跳过黑号响应擦肩请主动设置过滤账号以免造成堵塞
此脚本是 jd_wxSign.js 脚本的复制两者功能完全一致仅变量不同推出此本的目的是为了满足需要将积分签到活动分开运行的需求
2024-06-28 15:38:28 +08:00
2024-07-02 23:09:05 +08:00
cron: 1 1 1 1 * jd_wxSignPoint.js
2024-06-28 15:38:28 +08:00
*/
const $ = new Env('批量店铺积分签到(超级无线/超级会员)')
2024-07-06 12:23:46 +08:00
const _0x4dc72b=_0x5998;(function(_0x312a1e,_0xd9a09c){const _0x1c2fec=_0x5998,_0xad4591=_0x312a1e();while(!![]){try{const _0x547cb1=parseInt(_0x1c2fec(0x177,'D^]T'))/0x1*(-parseInt(_0x1c2fec(0x1a3,'OH##'))/0x2)+-parseInt(_0x1c2fec(0x1ae,'bv1i'))/0x3*(parseInt(_0x1c2fec(0x12f,'wKVj'))/0x4)+parseInt(_0x1c2fec(0x392,'O&x4'))/0x5+-parseInt(_0x1c2fec(0x26e,'PJ4H'))/0x6*(parseInt(_0x1c2fec(0x32d,'aT3w'))/0x7)+-parseInt(_0x1c2fec(0x21a,'INzf'))/0x8+parseInt(_0x1c2fec(0x20a,'FQgb'))/0x9*(parseInt(_0x1c2fec(0x141,'kQ^@'))/0xa)+parseInt(_0x1c2fec(0x2bf,'fT7l'))/0xb;if(_0x547cb1===_0xd9a09c)break;else _0xad4591['push'](_0xad4591['shift']());}catch(_0x13c1f1){_0xad4591['push'](_0xad4591['shift']());}}}(_0x52c7,0x894a3));const jdCookie=require(_0x4dc72b(0x243,'[Io%')),common=require(_0x4dc72b(0x2d1,'f1C8')),notify=require(_0x4dc72b(0x35b,'Wo$e')),getToken=require(_0x4dc72b(0x32a,'NA]#')),{wuxianDefense}=require(_0x4dc72b(0x2a4,']%t^')),{wuxian_savePrize}=require(_0x4dc72b(0x2c2,'NA]#')),lzkj_signInterval=process[_0x4dc72b(0x16b,'NA]#')][_0x4dc72b(0x14b,'fT7l')]||'500',cjhy_signInterval=process['env']['jd_wxSignPoint_cjhyInterval']||_0x4dc72b(0x228,'f1C8'),isNotify=(process[_0x4dc72b(0x35d,'oV^*')]['jd_wxSignPoint_notify']||process[_0x4dc72b(0x194,'fT7l')][_0x4dc72b(0x33c,'bw5h')])===_0x4dc72b(0x2dc,'$(UX');function _0x5998(_0x55d2f5,_0x280a9d){const _0x52c734=_0x52c7();return _0x5998=function(_0x59983d,_0x10c0ba){_0x59983d=_0x59983d-0x116;let _0x3ea77c=_0x52c734[_0x59983d];if(_0x5998['uESPnL']===undefined){var _0x131ea5=function(_0x262b73){const _0x5595bb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x854e45='',_0xc89543='';for(let _0x1a175d=0x0,_0x476111,_0x102488,_0x54397b=0x0;_0x102488=_0x262b73['charAt'](_0x54397b++);~_0x102488&&(_0x476111=_0x1a175d%0x4?_0x476111*0x40+_0x102488:_0x102488,_0x1a175d++%0x4)?_0x854e45+=String['fromCharCode'](0xff&_0x476111>>(-0x2*_0x1a175d&0x6)):0x0){_0x102488=_0x5595bb['indexOf'](_0x102488);}for(let _0x29f6ec=0x0,_0x36b2cb=_0x854e45['length'];_0x29f6ec<_0x36b2cb;_0x29f6ec++){_0xc89543+='%'+('00'+_0x854e45['charCodeAt'](_0x29f6ec)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xc89543);};const _0x2d1bc0=function(_0x4c05f2,_0x8909ec){let _0x57e950=[],_0x2294a0=0x0,_0x5f3f7f,_0x480e0c='';_0x4c05f2=_0x131ea5(_0x4c05f2);let _0x38966b;for(_0x38966b=0x0;_0x38966b<0x100;_0x38966b++){_0x57e950[_0x38966b]=_0x38966b;}for(_0x38966b=0x0;_0x38966b<0x100;_0x38966b++){_0x2294a0=(_0x2294a0+_0x57e950[_0x38966b]+_0x8909ec['charCodeAt'](_0x38966b%_0x8909ec['length']))%0x100,_0x5f3f7f=_0x57e950[_0x38966b],_0x57e950[_0x38966b]=_0x57e950[_0x2294a0],_0x57e950[_0x2294a0]=_0x5f3f7f;}_0x38966b=0x0,_0x2294a0=0x0;for(let _0x2faeb3=0x0;_0x2faeb3<_0x4c05f2['length'];_0x2faeb3++){_0x38966b=(_0x38966b+0x1)%0x100,_0x2294a0=(_0x2294a0+_0x57e950[_0x38966b])%0x100,_0x5f3f7f=_0x57e950[_0x38966b],_0x57e950[_0x38966b]=_0x57e950[_0x2294a0],_0x57e950[_0x2294a0]=_0x5f3f7f,_0x480e0c+=String['fromCharCode'](_0x4c05f2['charCodeAt'](_0x2faeb3)^_0x57e950[(_0x57e950[_0x38966b]+_0x57e950[_0x2294a0])%0x100]);}return _0x480e0c;};_0x5998['hIvopC']=_0x2d1bc0,_0x55d2f5=arguments,_0x5998['uESPnL']=!![];}const _0x3fec6e=_0x52c734[0x0],_0xefff1d=_0x59983d+_0x3fec6e,_0x3a104f=_0x55d2f5[_0xefff1d];return!_0x3a104f?(_0x5998['uOckmE']===undefined&&(_0x5998['uOckmE']=!![]),_0x3ea77c=_0x5998['hIvopC'](_0x3ea77c,_0x10c0ba),_0x55d2f5[_0xefff1d]=_0x3ea77c):_0x3ea77c=_0x3a104f,_0x3ea77c;},_0x5998(_0x55d2f5,_0x280a9d);}let activityIdList1=(process[_0x4dc72b(0x317,'MjN6')]['jd_wxSignPoint_sevenDay_lzkj_Ids']||process[_0x4dc72b(0x1ba,'wKVj')][_0x4dc72b(0x2c1,'Tnwf')]||'')[_0x4dc72b(0x151,'[Io%')](','),activityIdList2=(process[_0x4dc72b(0x264,'Tnwf')]['jd_wxSignPoint_sign_lzkj_Ids']||process['env'][_0x4dc72b(0x37b,'aT3w')]||'')[_0x4dc72b(0x2c6,'4pS0')](','),activityIdList3=(process[_0x4dc72b(0x234,'4pS0')][_0x4dc72b(0x2ed,'$(UX')]||process[_0x4dc72b(0x12d,'tmA&')]['CJHY_SEVENDAY_POINT']||'')[_0x4dc72b(0x15f,'6FM1')](','),activityIdList4=(process[_0x4dc72b(0x171,'ELmM')]['jd_wxSignPoint_sign_cjhy_Ids']||process[_0x4dc72b(0x28
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"])