mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
28 lines
41 KiB
JavaScript
28 lines
41 KiB
JavaScript
|
/*
|
|||
|
活动名称:店铺关注有礼
|
|||
|
活动链接:店铺首页关注按钮
|
|||
|
环境变量:jd_drawShopGift_argv // 活动参数,支持两种格式:”<shopId(店铺id)>_<venderId(商家id)>“ 或 ”<活动店铺首页链接>“
|
|||
|
jd_drawShopGift_threads // 控制并发线程数(正整数),默认1,最大5
|
|||
|
jd_drawShopGift_interval // 自定义运行间隔时长(整数,单位毫秒),默认1000
|
|||
|
jd_drawShopGift_notify // 是否推送通知(true/false),默认不推送
|
|||
|
|
|||
|
⚠ 请勿滥用自动化工具解析的店铺链接作为变量使用本脚本!请确认活动有效性后再使用!
|
|||
|
⚠ 因自动化程序滥用严重导致官方接口受影响,现在必须同时提供店铺和商家id才可运行!
|
|||
|
|
|||
|
高并发脚本,黑号领不到奖品
|
|||
|
活动限制IP严重,建议使用代理,谨慎使用并发
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('店铺关注有礼')
|
|||
|
const jdCookie = require('./jdCookie')
|
|||
|
const notify = require('./function/sendJDNotify')
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';const Il1ilIli=lIIliI;(function(IlII1liI,ilIl1lil,l1il1lIl,Il1Il1i1,llI1lill,li1lliil,IIill1Ii){return IlII1liI=IlII1liI>>0x8,li1lliil='hs',IIill1Ii='hs',function(Iill1ii,l1iliii,I1ii1ii,li1Iii1,I11l1II1){const liiil1I=lIIliI;li1Iii1='tfi',li1lliil=li1Iii1+li1lliil,I11l1II1='up',IIill1Ii+=I11l1II1,li1lliil=I1ii1ii(li1lliil),IIill1Ii=I1ii1ii(IIill1Ii),I1ii1ii=0x0;const IIlil1i1=Iill1ii();while(!![]&&--Il1Il1i1+l1iliii){try{li1Iii1=-parseInt(liiil1I(0x28e,'@7Q^'))/0x1*(parseInt(liiil1I(0x379,'Uvap'))/0x2)+-parseInt(liiil1I(0x21e,'k45H'))/0x3+parseInt(liiil1I(0x225,'GTF8'))/0x4+-parseInt(liiil1I(0x20a,'MgWk'))/0x5+-parseInt(liiil1I(0x232,'YQ!7'))/0x6+parseInt(liiil1I(0x2c2,'l9DL'))/0x7*(-parseInt(liiil1I(0x2f5,'YQ!7'))/0x8)+parseInt(liiil1I(0x2d2,'Pu4t'))/0x9;}catch(I1li1l1i){li1Iii1=I1ii1ii;}finally{I11l1II1=IIlil1i1[li1lliil]();if(IlII1liI<=Il1Il1i1)I1ii1ii?llI1lill?li1Iii1=I11l1II1:llI1lill=I11l1II1:I1ii1ii=I11l1II1;else{if(I1ii1ii==llI1lill['replace'](/[PDIQLEpGYnxMSFNOyJ=]/g,'')){if(li1Iii1===l1iliii){IIlil1i1['un'+li1lliil](I11l1II1);break;}IIlil1i1[IIill1Ii](I11l1II1);}}}}}(l1il1lIl,ilIl1lil,function(li1il1li,liI1II11,IilIl1ll,IliI1III,II1iI1lI,IIiiiII,I1IIIiil){return liI1II11='\x73\x70\x6c\x69\x74',li1il1li=arguments[0x0],li1il1li=li1il1li[liI1II11](''),IilIl1ll=`\x72\x65\x76\x65\x72\x73\x65`,li1il1li=li1il1li[IilIl1ll]('\x76'),IliI1III=`\x6a\x6f\x69\x6e`,(0x165d0a,li1il1li[IliI1III](''));});}(0xc800,0x60621,ii1lIliI,0xca),ii1lIliI)&&(iil=0x70);function lIIliI(_0x4ccffd,_0x57b51c){const _0x1a989a=ii1lIliI();return lIIliI=function(_0x21e56e,_0x3616bd){_0x21e56e=_0x21e56e-0x1b8;let _0x1c41ed=_0x1a989a[_0x21e56e];if(lIIliI['dtZLMG']===undefined){var _0x3a7f6a=function(_0x4a2503){const _0x418c25='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x12aa35='',_0x2ee18f='';for(let _0x1d230a=0x0,_0x26c377,_0x23190d,_0x12ee22=0x0;_0x23190d=_0x4a2503['charAt'](_0x12ee22++);~_0x23190d&&(_0x26c377=_0x1d230a%0x4?_0x26c377*0x40+_0x23190d:_0x23190d,_0x1d230a++%0x4)?_0x12aa35+=String['fromCharCode'](0xff&_0x26c377>>(-0x2*_0x1d230a&0x6)):0x0){_0x23190d=_0x418c25['indexOf'](_0x23190d);}for(let _0x1a5ba7=0x0,_0x94e9c7=_0x12aa35['length'];_0x1a5ba7<_0x94e9c7;_0x1a5ba7++){_0x2ee18f+='%'+('00'+_0x12aa35['charCodeAt'](_0x1a5ba7)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2ee18f);};const _0x348c31=function(_0x3a9636,_0x415b76){let _0x3d28eb=[],_0x56deac=0x0,_0x200073,_0x4d1fb1='';_0x3a9636=_0x3a7f6a(_0x3a9636);let _0x59b8f5;for(_0x59b8f5=0x0;_0x59b8f5<0x100;_0x59b8f5++){_0x3d28eb[_0x59b8f5]=_0x59b8f5;}for(_0x59b8f5=0x0;_0x59b8f5<0x100;_0x59b8f5++){_0x56deac=(_0x56deac+_0x3d28eb[_0x59b8f5]+_0x415b76['charCodeAt'](_0x59b8f5%_0x415b76['length']))%0x100,_0x200073=_0x3d28eb[_0x59b8f5],_0x3d28eb[_0x59b8f5]=_0x3d28eb[_0x56deac],_0x3d28eb[_0x56deac]=_0x200073;}_0x59b8f5=0x0,_0x56deac=0x0;for(let _0x541a68=0x0;_0x541a68<_0x3a9636['length'];_0x541a68++){_0x59b8f5=(_0x59b8f5+0x1)%0x100,_0x56deac=(_0x56deac+_0x3d28eb[_0x59b8f5])%0x100,_0x200073=_0x3d28eb[_0x59b8f5],_0x3d28eb[_0x59b8f5]=_0x3d28eb[_0x56deac],_0x3d28eb[_0x56deac]=_0x200073,_0x4d1fb1+=String['fromCharCode'](_0x3a9636['charCodeAt'](_0x541a68)^_0x3d28eb[(_0x3d28eb[_0x59b8f5]+_0x3d28eb[_0x56deac])%0x100]);}return _0x4d1fb1;};lIIliI['qkilLs']=_0x348c31,_0x4ccffd=arguments,lIIliI['dtZLMG']=!![];}const _0x2b3829=_0x1a989a[0x0],_0x56e75f=_0x21e56e+_0x2b3829,_0x1d8097=_0x4ccffd[_0x56e75f];return!_0x1d8097?(lIIliI['VIxMUw']===undefined&&(lIIliI['VIxMUw']=!![]),_0x1c41ed=lIIliI['qkilLs'](_0x1c41ed,_0x3616bd),_0x4ccffd[_0x56e75f]=_0x1c41ed):_0x1c41ed=_0x1d8097,_0x1c41ed;},lIIliI(_0x4ccffd,_0x57b51c);}const activityArgv=process[Il1ilIli(0x27a,'mh&Z')][Il1ilIli(0x255,'U1P(')]||'';let taskThreads=process[Il1ilIli(0x29a,'k45H')][Il1ilIli(0x1fb,'e3Lw')]||'1';const runInterval=process[Il1ilIli(0x1c5,'U1P(')][Il1ilIli(0x201,'qK]n')]||Il1ilIli(0x342,'GNPo'),isNotify=(process[Il1ilIli(0x28a,'fler')][Il1ilIli(0x2d1,'fler')]||process[Il1ilIli(0x259,'Yq48')][Il1ilIli(0x362,'W3Fz')])===Il1ilIli(0x23e,'Hu%B'),cookiesArr=Object[Il1ilIli(0x2e
|
|||
|
|
|||
|
// 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"])
|