faker3/jd_wyw.js

17 lines
50 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
2024-07-15 14:28:01 +08:00
活动名称新版玩一玩 5.17-8.31结束
活动入口APP-我的-更多工具-玩一玩
活动建议定时自行修改奖票有效期2个月
活动变量jd_wyw_notify // 是否推送通知true/false默认不推送
jd_wyw_pinFilter // 账号pin过滤多个用@进行分割
如开启翻倍请自行修改定时建议运行10次每次间隔30分钟以上
cron:1 6,14,18 * * *
2024-06-28 15:38:28 +08:00
*/
2024-07-15 14:28:01 +08:00
const $ = new Env('新版玩一玩')
2024-07-18 13:00:42 +08:00
const _0x3dc07d=_0x7381;(function(_0x18c358,_0x22d61b){const _0x3833a0=_0x7381,_0x4d10d0=_0x18c358();while(!![]){try{const _0x2a1187=-parseInt(_0x3833a0(0xc6,'*ZFb'))/0x1+parseInt(_0x3833a0(0xc3,'altS'))/0x2*(-parseInt(_0x3833a0(0x138,'DzH8'))/0x3)+-parseInt(_0x3833a0(0x1ae,'mln['))/0x4+parseInt(_0x3833a0(0x20e,'YWgE'))/0x5*(-parseInt(_0x3833a0(0x9b,'AgCw'))/0x6)+-parseInt(_0x3833a0(0x192,'*ZFb'))/0x7+-parseInt(_0x3833a0(0xdd,'QOS!'))/0x8+parseInt(_0x3833a0(0x214,'Wp5c'))/0x9;if(_0x2a1187===_0x22d61b)break;else _0x4d10d0['push'](_0x4d10d0['shift']());}catch(_0x3ed08b){_0x4d10d0['push'](_0x4d10d0['shift']());}}}(_0x4bc8,0xe00b9));const jdCookie=require('./jdCookie'),notify=require(_0x3dc07d(0x16b,'QOS!')),common=require(_0x3dc07d(0xf0,'3TqI')),{H5st,jsTk}=require(_0x3dc07d(0x159,'F(AB'));let turnlinkId=_0x3dc07d(0x113,'%$U['),superlinkId=_0x3dc07d(0x190,'bxO4'),taskThreads=process[_0x3dc07d(0x1a2,'mln[')][_0x3dc07d(0x18a,'UpB)')]||'1';const runInterval=process['env'][_0x3dc07d(0x1c8,'tJ&S')]||_0x3dc07d(0x188,'bxO4'),isNotify=(process['env'][_0x3dc07d(0x180,']X[4')]||process[_0x3dc07d(0x16d,'!2z%')][_0x3dc07d(0x181,'F(AB')])==='true',pinFilter=(process[_0x3dc07d(0xb9,'AgCw')]['jd_wyw_pinFilter']||'')[_0x3dc07d(0x19d,'zP83')]('@');let turnNum=process[_0x3dc07d(0x23a,'dYuj')][_0x3dc07d(0xfe,'d5RQ')]||'50',turnmaxTime=process[_0x3dc07d(0x24d,'zP83')][_0x3dc07d(0x111,'altS')]||'2',errMsgPin=[],shareCodes=[],needRemoveCodes=[],cookiesArr=Object[_0x3dc07d(0xcb,'YWgE')](jdCookie)[_0x3dc07d(0x184,'Cjl[')](_0x2a01ab=>jdCookie[_0x2a01ab])[_0x3dc07d(0x258,']X[4')](_0xbd449d=>_0xbd449d);!cookiesArr[0x0]&&($['msg']($['name'],_0x3dc07d(0x1a0,'YWgE')),process['exit'](0x1));!(async()=>{const _0x14c3e9=_0x3dc07d;notify[_0x14c3e9(0x193,'Cjl[')]({'title':$[_0x14c3e9(0x18b,'!fNd')]}),await Main(),isNotify&&notify[_0x14c3e9(0x1ee,'cRB%')]()&&await notify['push']();})()[_0x3dc07d(0x1c3,'5T#H')](_0x433929=>$[_0x3dc07d(0x1e0,'!fNd')](_0x433929))[_0x3dc07d(0xaa,'J#fm')](()=>$[_0x3dc07d(0x1e8,'Dwau')]());async function Main(){const _0x59b101=_0x3dc07d;try{try{const _0x37698e=parseInt(taskThreads);_0x37698e>0x0&&_0x37698e!==0x1&&(taskThreads=_0x37698e);}catch{taskThreads=0x1;}taskThreads=Math['min'](taskThreads,0x1),$[_0x59b101(0xcc,'yEkw')]=null;if(runInterval)try{const _0x1d4129=parseInt(runInterval);_0x1d4129>=0x0&&($[_0x59b101(0x1b5,'Cjl[')]=_0x1d4129);}catch{console[_0x59b101(0x155,'J#fm')](_0x59b101(0x1d2,'!2z%'));}console[_0x59b101(0x225,'TJcU')](_0x59b101(0x185,'aYT*')+$[_0x59b101(0xf4,'8VHk')]+'变量开启状态=========='),console[_0x59b101(0x254,'eo(z')]('活动入口:\x20APP-我的-更多工具-玩一玩'),console[_0x59b101(0x14f,'W*Qm')]('代理开关:\x20['+common[_0x59b101(0xae,'%$U[')]()+']'),console[_0x59b101(0x13f,'%$U[')](_0x59b101(0x95,'YWgE')+(isNotify?'开启':'关闭')+']'),console['log']('账号过滤:\x20['+pinFilter[_0x59b101(0x227,'u11N')](',\x20')+']'),console[_0x59b101(0xef,'eCug')](_0x59b101(0xc8,'kwE6')+$[_0x59b101(0x174,'altS')]+_0x59b101(0x147,']X[4')),console[_0x59b101(0x13f,'%$U[')](''),$[_0x59b101(0x23d,'Dwau')]=[],await common[_0x59b101(0xe0,'Vm]2')](taskThreads,cookiesArr,taskFnc),$[_0x59b101(0x19f,'bxO4')]=![],$[_0x59b101(0x228,'pY2)')]=![];$[_0x59b101(0x198,'Vm]2')][_0x59b101(0x9a,'!fNd')]>0x0&&(cookiesArr=cookiesArr[_0x59b101(0x106,'kwE6')]((_0x28c506,_0x457281)=>!$[_0x59b101(0x15b,'&neq')][_0x59b101(0x1d5,'sp&Y')](_0x457281+0x1)),$['needRemoveCookieIndex']=[]);const _0x3336a1=notify['getMessage']();_0x3336a1&&console[_0x59b101(0x125,'kwE6')](_0x59b101(0x1e9,'yUj(')+_0x3336a1[_0x59b101(0x1da,'h65^')](//g,_0x59b101(0x23f,'tJ&S')));if(errMsgPin[_0x59b101(0x1fd,'bxO4')]>0x0){let _0x2bd013=_0x59b101(0x132,'u11N')+errMsgPin[_0x59b101(0x1e3,'YIuS')]('&')+'\x22';console[_0x59b101(0x17c,'(%zw')](_0x2bd013);}}catch(_0x505446){console[_0x59b101(0xb8,'pY2)')]('❌\x20脚本运行遇到了错误\x0a'+_0x505446);}}function _0x7381(_0x4774fe,_0xde90b6){const _0x4bc823=_0x4bc8();return _0x7381=function(_0x73812b,_0x31b8b3){_0x73812b=_0x73812b-0x86;let _0x4ddb63=_0x4bc823[_0x73812b];if(_0x7381['baXMKY']===undefined){var
2024-07-15 14:28:01 +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"])