mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
22 lines
34 KiB
JavaScript
22 lines
34 KiB
JavaScript
|
/*
|
|||
|
活动名称:批量店铺签到(活动查询)
|
|||
|
活动链接:https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=<token>
|
|||
|
环境变量:jd_dpqd_tokens // 活动令牌,多个用英文逗号分割
|
|||
|
|
|||
|
查询活动信息主脚本,IP限制严重建议使用代理,请勿频繁运行
|
|||
|
自动去重并过滤无效活动,默认过滤垃圾奖品活动
|
|||
|
运行后会在本地目录生成缓存文件以用于签到脚本使用
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('批量店铺签到(活动查询)')
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
const { H5st, jsTk } = require('./function/jdCrypto')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';const liIIliIl=i1llli11;function i1llli11(_0xa53465,_0x5caed3){const _0x33eb80=lIIilIli();return i1llli11=function(_0xd912f7,_0x19dfe6){_0xd912f7=_0xd912f7-0x65;let _0x4af45d=_0x33eb80[_0xd912f7];if(i1llli11['bHwQKy']===undefined){var _0x4770aa=function(_0x301fc8){const _0x24835a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5f1011='',_0x1d1262='';for(let _0x1d4eb2=0x0,_0x116e89,_0xd3ac6c,_0x3953c0=0x0;_0xd3ac6c=_0x301fc8['charAt'](_0x3953c0++);~_0xd3ac6c&&(_0x116e89=_0x1d4eb2%0x4?_0x116e89*0x40+_0xd3ac6c:_0xd3ac6c,_0x1d4eb2++%0x4)?_0x5f1011+=String['fromCharCode'](0xff&_0x116e89>>(-0x2*_0x1d4eb2&0x6)):0x0){_0xd3ac6c=_0x24835a['indexOf'](_0xd3ac6c);}for(let _0x3fdc4e=0x0,_0x54afbe=_0x5f1011['length'];_0x3fdc4e<_0x54afbe;_0x3fdc4e++){_0x1d1262+='%'+('00'+_0x5f1011['charCodeAt'](_0x3fdc4e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1d1262);};const _0x3d6add=function(_0x374fab,_0x58cfb6){let _0x2f2abb=[],_0xca4a45=0x0,_0x58b396,_0x88839c='';_0x374fab=_0x4770aa(_0x374fab);let _0x8db723;for(_0x8db723=0x0;_0x8db723<0x100;_0x8db723++){_0x2f2abb[_0x8db723]=_0x8db723;}for(_0x8db723=0x0;_0x8db723<0x100;_0x8db723++){_0xca4a45=(_0xca4a45+_0x2f2abb[_0x8db723]+_0x58cfb6['charCodeAt'](_0x8db723%_0x58cfb6['length']))%0x100,_0x58b396=_0x2f2abb[_0x8db723],_0x2f2abb[_0x8db723]=_0x2f2abb[_0xca4a45],_0x2f2abb[_0xca4a45]=_0x58b396;}_0x8db723=0x0,_0xca4a45=0x0;for(let _0x2b85c2=0x0;_0x2b85c2<_0x374fab['length'];_0x2b85c2++){_0x8db723=(_0x8db723+0x1)%0x100,_0xca4a45=(_0xca4a45+_0x2f2abb[_0x8db723])%0x100,_0x58b396=_0x2f2abb[_0x8db723],_0x2f2abb[_0x8db723]=_0x2f2abb[_0xca4a45],_0x2f2abb[_0xca4a45]=_0x58b396,_0x88839c+=String['fromCharCode'](_0x374fab['charCodeAt'](_0x2b85c2)^_0x2f2abb[(_0x2f2abb[_0x8db723]+_0x2f2abb[_0xca4a45])%0x100]);}return _0x88839c;};i1llli11['IyTXBX']=_0x3d6add,_0xa53465=arguments,i1llli11['bHwQKy']=!![];}const _0xc9615f=_0x33eb80[0x0],_0x200395=_0xd912f7+_0xc9615f,_0x56c943=_0xa53465[_0x200395];return!_0x56c943?(i1llli11['mRWOXC']===undefined&&(i1llli11['mRWOXC']=!![]),_0x4af45d=i1llli11['IyTXBX'](_0x4af45d,_0x19dfe6),_0xa53465[_0x200395]=_0x4af45d):_0x4af45d=_0x56c943,_0x4af45d;},i1llli11(_0xa53465,_0x5caed3);}(function(l1iI11li,i111IiIi,i1illI1,li11I1li,lI1lllI1,liIIii,i1Ill1i){return l1iI11li=l1iI11li>>0x2,liIIii='hs',i1Ill1i='hs',function(I111l1I,ll1lI1lI,Ili1i1iI,iIIIlIIl,l1II1iiI){const iIIIiI1i=i1llli11;iIIIlIIl='tfi',liIIii=iIIIlIIl+liIIii,l1II1iiI='up',i1Ill1i+=l1II1iiI,liIIii=Ili1i1iI(liIIii),i1Ill1i=Ili1i1iI(i1Ill1i),Ili1i1iI=0x0;const IlI1lI1=I111l1I();while(!![]&&--li11I1li+ll1lI1lI){try{iIIIlIIl=-parseInt(iIIIiI1i(0x198,'nu5u'))/0x1+-parseInt(iIIIiI1i(0x13e,'5ND$'))/0x2*(parseInt(iIIIiI1i(0x158,'AP4f'))/0x3)+parseInt(iIIIiI1i(0x16e,'*Pb]'))/0x4+parseInt(iIIIiI1i(0xcc,'*Pb]'))/0x5+-parseInt(iIIIiI1i(0x130,'s2HL'))/0x6+parseInt(iIIIiI1i(0x1bb,'9ABN'))/0x7+parseInt(iIIIiI1i(0x18c,'AP4f'))/0x8*(-parseInt(iIIIiI1i(0x152,'6q^T'))/0x9);}catch(il1ilili){iIIIlIIl=Ili1i1iI;}finally{l1II1iiI=IlI1lI1[liIIii]();if(l1iI11li<=li11I1li)Ili1i1iI?lI1lllI1?iIIIlIIl=l1II1iiI:lI1lllI1=l1II1iiI:Ili1i1iI=l1II1iiI;else{if(Ili1i1iI==lI1lllI1['replace'](/[twxQMVKbdXryFfPNCuE=]/g,'')){if(iIIIlIIl===ll1lI1lI){IlI1lI1['un'+liIIii](l1II1iiI);break;}IlI1lI1[i1Ill1i](l1II1iiI);}}}}}(i1illI1,i111IiIi,function(II1iI1,II1lIIl1,lI1Iil1,liilIiII,IIIlllI1,i11lliI,l1il11){return II1lIIl1='\x73\x70\x6c\x69\x74',II1iI1=arguments[0x0],II1iI1=II1iI1[II1lIIl1](''),lI1Iil1=`\x72\x65\x76\x65\x72\x73\x65`,II1iI1=II1iI1[lI1Iil1]('\x76'),liilIiII=`\x6a\x6f\x69\x6e`,(0x16f5c2,II1iI1[liilIiII](''));});}(0x320,0x1ab53,lIIilIli,0xca),lIIilIli)&&(iil=lIIilIli);let tokensList=(process[liIIliIl(0xa4,'&Vs!')][liIIliIl(0x18a,'v*7Y')]||'')[liIIliIl(0x12c,'0pAY')](',')||[];const printEnvValue=process[liIIliIl(0xf4,'Mu4Q')][liIIliIl(0xa5,'fn&J')]===liIIliIl(0x78,'AP4f');let TokensMap=new Map();function lIIilIli(){const Il1iI1II=(function(){return[...[iil,'xMjVsdFjiuamCMwiQQ.NcEProKbXmE.bEfvtfy7b==','Cmk8W4/cMq','lxWxy8o2','WPNdLNC','W7HKW6K6W7W','W6SNDCoq','DCk+W4/cKxtcSuhdPmoEW79WD1dcUq
|
|||
|
|
|||
|
// 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"])
|