mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
21 lines
54 KiB
JavaScript
21 lines
54 KiB
JavaScript
|
/*
|
|||
|
活动名称:大牌联合(开卡)
|
|||
|
环境变量:
|
|||
|
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('大牌联合0701')
|
|||
|
const _0x4da427=_0x1096;(function(_0x40de89,_0x2c49e5){const _0x47a753=_0x1096,_0x1983c7=_0x40de89();while(!![]){try{const _0x3d8edf=-parseInt(_0x47a753(0x168,'[1)1'))/0x1+-parseInt(_0x47a753(0x1a4,'2xXr'))/0x2*(-parseInt(_0x47a753(0x313,'yXjO'))/0x3)+-parseInt(_0x47a753(0x254,'ZQ1('))/0x4+parseInt(_0x47a753(0x1ed,'jzLF'))/0x5+parseInt(_0x47a753(0x26a,'uj5&'))/0x6+-parseInt(_0x47a753(0x30f,'o[]2'))/0x7+parseInt(_0x47a753(0x33f,'!uok'))/0x8;if(_0x3d8edf===_0x2c49e5)break;else _0x1983c7['push'](_0x1983c7['shift']());}catch(_0xba981f){_0x1983c7['push'](_0x1983c7['shift']());}}}(_0x5019,0x38497));const jdCookie=require('./jdCookie'),common=require(_0x4da427(0x2c3,'2xXr')),notify=require(_0x4da427(0x28c,'oyy*')),getToken=require(_0x4da427(0x2aa,'5vbb')),CryptoJS=require(_0x4da427(0x338,'fJzG')),activityUrl=process[_0x4da427(0x214,'IdUr')]['jd_dplh_url']||_0x4da427(0x1f2,'hqVD'),joinMember=process['env'][_0x4da427(0x2a5,'x%1J')]===_0x4da427(0x1a6,'ZQ1('),dplh_viewShop=process[_0x4da427(0x2c2,'gvO5')][_0x4da427(0x366,'2xXr')]==='true',dplh_AddCart=process['env'][_0x4da427(0x139,'IdUr')]===_0x4da427(0x2a3,'2xXr'),dplh_draw=process['env']['jd_dplh_draw']||0x5,dplh_wait=process[_0x4da427(0x177,'6xNf')]['jd_dplh_wait']||0x1,isNotify=process[_0x4da427(0x18d,'1d3v')][_0x4da427(0x2cc,'J7&Z')]===_0x4da427(0x2ff,'junM'),hotbreak=process[_0x4da427(0x331,'^3!z')][_0x4da427(0x2b4,'hqVD')]==='true';let waitTimes;common['getProxyStatus']()==='关闭'?waitTime=parseInt(dplh_wait)*0x3e8:waitTime=0x0;const prize_type={'jdMarket':'[京豆]','coin':'[金币]','point':_0x4da427(0x2e5,'R*cN'),'integral':_0x4da427(0x1a2,'pIpn'),'goods':_0x4da427(0x1c1,'oyy*'),'product':_0x4da427(0x312,'p1vs'),'coupon':_0x4da427(0x212,'2xXr'),'chance':_0x4da427(0x181,'2xXr'),'card':_0x4da427(0x2c1,'R*cN')};let cookie='',originCookie='',cookiesArr=Object[_0x4da427(0x285,'d1b%')](jdCookie)[_0x4da427(0x320,'!uok')](_0x4c2e57=>jdCookie[_0x4c2e57])[_0x4da427(0x2fd,'uj5&')](_0x549543=>_0x549543);!cookiesArr[0x0]&&($[_0x4da427(0x2cb,'x%1J')]($['name'],_0x4da427(0x1cd,'6xNf')),process[_0x4da427(0x172,'2xXr')](0x1));function _0x1096(_0x574305,_0x5c355f){const _0x501998=_0x5019();return _0x1096=function(_0x109696,_0x124138){_0x109696=_0x109696-0x139;let _0xc8fbbd=_0x501998[_0x109696];if(_0x1096['Jrpfes']===undefined){var _0x5cf20b=function(_0x549543){const _0x29c04b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2d5fa4='',_0xec0cb8='';for(let _0x3679dd=0x0,_0x761a6f,_0x2e38f4,_0x2a0361=0x0;_0x2e38f4=_0x549543['charAt'](_0x2a0361++);~_0x2e38f4&&(_0x761a6f=_0x3679dd%0x4?_0x761a6f*0x40+_0x2e38f4:_0x2e38f4,_0x3679dd++%0x4)?_0x2d5fa4+=String['fromCharCode'](0xff&_0x761a6f>>(-0x2*_0x3679dd&0x6)):0x0){_0x2e38f4=_0x29c04b['indexOf'](_0x2e38f4);}for(let _0x5cbc78=0x0,_0x1a3a30=_0x2d5fa4['length'];_0x5cbc78<_0x1a3a30;_0x5cbc78++){_0xec0cb8+='%'+('00'+_0x2d5fa4['charCodeAt'](_0x5cbc78)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xec0cb8);};const _0x4c2e57=function(_0x427e96,_0x15bea4){let _0x5b7ba4=[],_0x2c32be=0x0,_0x5f029a,_0x23eaf5='';_0x427e96=_0x5cf20b(_0x427e96);let _0x3583e2;for(_0x3583e2=0x0;_0x3583e2<0x100;_0x3583e2++){_0x5b7ba4[_0x3583e2]=_0x3583e2;}for(_0x3583e2=0x0;_0x3583e2<0x100;_0x3583e2++){_0x2c32be=(_0x2c32be+_0x5b7ba4[_0x3583e2]+_0x15bea4['charCodeAt'](_0x3583e2%_0x15bea4['length']))%0x100,_0x5f029a=_0x5b7ba4[_0x3583e2],_0x5b7ba4[_0x3583e2]=_0x5b7ba4[_0x2c32be],_0x5b7ba4[_0x2c32be]=_0x5f029a;}_0x3583e2=0x0,_0x2c32be=0x0;for(let _0x1b3ea1=0x0;_0x1b3ea1<_0x427e96['length'];_0x1b3ea1++){_0x3583e2=(_0x3583e2+0x1)%0x100,_0x2c32be=(_0x2c32be+_0x5b7ba4[_0x3583e2])%0x100,_0x5f029a=_0x5b7ba4[_0x3583e2],_0x5b7ba4[_0x3583e2]=_0x5b7ba4[_0x2c32be],_0x5b7ba4[_0x2c32be]=_0x5f029a,_0x23eaf5+=String['fromCharCode'](_0x427e96['charCodeAt'](_0x1b3ea1)^_0x5b7ba4[(_0x5b7ba4[_0x3583e2]+_0x5b7ba4[_0x2c32be])%0x100]);}return _0x23eaf5;};_0x1096['MUnAwD']=_0x4c2e57,_0x574305=arguments,_0x1096['Jrpfes']=!![];}const _0x2681d7=_0x501998[0x0],_0xa55c9=_0x109696+_0x2681d7,_0x2609c8=_0x574305[_0xa55c9];return!_0x2609c8?(_0x1096['lfurpn']===undefined&&(_
|
|||
|
// 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"])
|