faker3/jd_dplh0806.js

22 lines
39 KiB
JavaScript
Raw Normal View History

2024-08-06 11:31:07 +08:00
/*
活动名称大牌联合开卡
环境变量
jd_dplh_viewShop // 是否true/false做浏览任务默认不做
jd_dplh_addCart // 是否true/false做加购任务默认不做
jd_dplh_draw // 抽奖次数,变量暂时无效
jd_dplh_blacklist // 黑名单 用&隔开 pin值
jd_dplh_Notify // 是否通知true/false默认不通知
jd_dplh_break // IP限制后继续执行true/false
实物奖品需要填写地址变量才行具体请查看 WIki
cron "1 1 1 1 *" script-path=jd_dplh.js
*/
const $ = new Env('大牌联合0806')
const _0x48fdbe=_0x2da7;(function(_0x12a1de,_0x22fa10){const _0x453f6b=_0x2da7,_0xc9835=_0x12a1de();while(!![]){try{const _0x130ec1=-parseInt(_0x453f6b(0x1d3))/0x1*(-parseInt(_0x453f6b(0x1a6))/0x2)+-parseInt(_0x453f6b(0x193))/0x3+parseInt(_0x453f6b(0x19a))/0x4*(-parseInt(_0x453f6b(0x18b))/0x5)+parseInt(_0x453f6b(0x15c))/0x6+parseInt(_0x453f6b(0x18f))/0x7*(parseInt(_0x453f6b(0x1e4))/0x8)+parseInt(_0x453f6b(0x1ff))/0x9*(-parseInt(_0x453f6b(0x1fc))/0xa)+parseInt(_0x453f6b(0x1a7))/0xb;if(_0x130ec1===_0x22fa10)break;else _0xc9835['push'](_0xc9835['shift']());}catch(_0x5ecad6){_0xc9835['push'](_0xc9835['shift']());}}}(_0x572e,0x73c28));function _0x2da7(_0x3347e4,_0x230c9d){const _0x572e3c=_0x572e();return _0x2da7=function(_0x2da76d,_0x521465){_0x2da76d=_0x2da76d-0x142;let _0x1f959b=_0x572e3c[_0x2da76d];return _0x1f959b;},_0x2da7(_0x3347e4,_0x230c9d);}const jdCookie=require(_0x48fdbe(0x241)),common=require('./utils/Rebels_jdCommon'),notify=require(_0x48fdbe(0x190)),getToken=require('./utils/Rebels_Token'),CryptoJS=require(_0x48fdbe(0x1b5)),activityUrl=process[_0x48fdbe(0x1ab)][_0x48fdbe(0x182)]||'4b6ef8d4fe6b4a79b25a79cbf252_240806',joinMember=process[_0x48fdbe(0x1ab)]['jd_dplh_opencard']===_0x48fdbe(0x17e),dplh_viewShop=process[_0x48fdbe(0x1ab)]['jd_dplh_viewShop']===_0x48fdbe(0x17e),dplh_AddCart=process[_0x48fdbe(0x1ab)]['jd_dplh_addCart']===_0x48fdbe(0x17e),dplh_draw=process['env'][_0x48fdbe(0x214)]||0x5,dplh_wait=process['env'][_0x48fdbe(0x1ac)]||0x1,isNotify=process[_0x48fdbe(0x1ab)][_0x48fdbe(0x208)]===_0x48fdbe(0x17e),hotbreak=process['env'][_0x48fdbe(0x16d)]==='true';let waitTimes=parseInt(dplh_wait)*0x3e8;const prize_type={'jdMarket':'[京豆]','coin':_0x48fdbe(0x232),'point':_0x48fdbe(0x1b0),'integral':_0x48fdbe(0x1b0),'goods':'[实物]','product':_0x48fdbe(0x1f6),'coupon':_0x48fdbe(0x20b),'chance':'[次数]','card':_0x48fdbe(0x1fe)};let cookie='',originCookie='',cookiesArr=Object['keys'](jdCookie)[_0x48fdbe(0x1c4)](_0x5b93f8=>jdCookie[_0x5b93f8])[_0x48fdbe(0x1b3)](_0x4e46e6=>_0x4e46e6);!cookiesArr[0x0]&&($['msg']($[_0x48fdbe(0x206)],_0x48fdbe(0x1a5)),process[_0x48fdbe(0x236)](0x1));$[_0x48fdbe(0x20a)]=process['env'][_0x48fdbe(0x164)]||'',getBlacklist(),$[_0x48fdbe(0x229)]=[],$[_0x48fdbe(0x209)]=[],!(async()=>{const _0x30312e=_0x48fdbe;console[_0x30312e(0x14e)](_0x30312e(0x189)+$[_0x30312e(0x206)]+_0x30312e(0x22a)),console[_0x30312e(0x14e)]('开卡类活动不会自动运行,请自行测试是否有水'),console[_0x30312e(0x14e)]('代理开关:\x20['+common[_0x30312e(0x1cf)]()+']'),console[_0x30312e(0x14e)]('间隔时长:\x20['+(waitTimes===0x0?'无':waitTimes/0x3e8+'秒')+_0x30312e(0x1b6)),console[_0x30312e(0x14e)]('浏览任务:\x20['+(dplh_viewShop?'开启':'关闭')+']'),console[_0x30312e(0x14e)](_0x30312e(0x1e2)+(dplh_AddCart?'开启':'关闭')+']'),console[_0x30312e(0x14e)](_0x30312e(0x198)+(hotbreak?'开启':'关闭')+']'),console[_0x30312e(0x14e)](_0x30312e(0x189)+$[_0x30312e(0x206)]+_0x30312e(0x1a4));if(!activityUrl){console[_0x30312e(0x14e)](_0x30312e(0x1a2));return;}authorCodeList=await getAuthorCodeList(_0x30312e(0x22d));authorCodeList?(console[_0x30312e(0x14e)]('\x0a服务状态正常活动获取成功'),$[_0x30312e(0x1d1)]=authorCodeList[random(0x0,authorCodeList[_0x30312e(0x145)])]):($[_0x30312e(0x1d1)]='',console[_0x30312e(0x14e)](_0x30312e(0x149)));$[_0x30312e(0x1f2)]=activityUrl;$[_0x30312e(0x1f2)]&&($['activityUrl'][_0x30312e(0x23e)](_0x30312e(0x23c))?$[_0x30312e(0x1c5)]=common[_0x30312e(0x1dc)](activityUrl,_0x30312e(0x1a1)):$['activityId']=$[_0x30312e(0x1f2)]);$[_0x30312e(0x237)]='jinggengjcq-isv.isvjcloud.com',$[_0x30312e(0x1f1)]=_0x30312e(0x1e1)+$['hostname'];if(!$[_0x30312e(0x1c5)]){console[_0x30312e(0x14e)](_0x30312e(0x20c));return;}notify[_0x30312e(0x1c2)]({'title':$['name']}),$[_0x30312e(0x159)]=_0x30312e(0x19e),$['inviteNick']=$[_0x30312e(0x1d1)];const _0x1d6297=process[_0x30312e(0x1ab)][_0x30312e(0x185)]?process[_0x30312e(0x1ab)][_0x30312e(0x185)]:'';if(_0x1d6297&&_0x1d6297!=''){const _0x1269e0=_0x1d6297[_0x30312e(0x152)]('|');$[_0x30312e(0x19f)]=Math[_0x30312e(0x1ea)](Math[_0x30312e(
// 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"])