mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-15 08:19:17 +08:00
27 lines
44 KiB
JavaScript
27 lines
44 KiB
JavaScript
|
/*
|
|||
|
活动名称:京东直播互动抽奖
|
|||
|
活动链接:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=<直播间id>
|
|||
|
环境变量:jd_liveLottery_ids // 直播间id,多个用英文逗号分割
|
|||
|
jd_liveLottery_threads // 控制并发线程数(正整数),默认1,最大5
|
|||
|
jd_liveLottery_interval // 自定义运行间隔时长(整数,单位毫秒),默认500
|
|||
|
jd_liveLottery_notify // 是否推送通知(true/false),默认不推送
|
|||
|
jd_liveLottery_pinFilter // 账号pin过滤,多个用@进行分割
|
|||
|
|
|||
|
高并发脚本,谨慎使用并发
|
|||
|
活动限制IP严重,建议使用代理
|
|||
|
黑号会持续擦肩,同一直播间活动请勿连续抽奖,以直播间悬浮标识为准
|
|||
|
|
|||
|
7 7 7 7 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('直播互动抽奖')
|
|||
|
const jdCookie = require('./jdCookie')
|
|||
|
const common = require('./function/jdCommon')
|
|||
|
const notify = require('./function/sendJDNotify')
|
|||
|
|
|||
|
var iil='jsjiami.com.v7';const lll1l1Ii=i11Iill;(function(ii11I1lI,liIilIii,llill1ii,Iil1iI1l,iIiiIl1i,Il1i1iIl,lIil1II1){return ii11I1lI=ii11I1lI>>0x4,Il1i1iIl='hs',lIil1II1='hs',function(IIIi11il,iI11Il1l,ilIi11ll,l1lIlIii,Ii1il1ll){const i111l11l=i11Iill;l1lIlIii='tfi',Il1i1iIl=l1lIlIii+Il1i1iIl,Ii1il1ll='up',lIil1II1+=Ii1il1ll,Il1i1iIl=ilIi11ll(Il1i1iIl),lIil1II1=ilIi11ll(lIil1II1),ilIi11ll=0x0;const i11IiiI=IIIi11il();while(!![]&&--Iil1iI1l+iI11Il1l){try{l1lIlIii=-parseInt(i111l11l(0x2e6,'@kyU'))/0x1+-parseInt(i111l11l(0x168,'I[(m'))/0x2*(parseInt(i111l11l(0x1d4,'nUwX'))/0x3)+-parseInt(i111l11l(0x17b,'1i(d'))/0x4+parseInt(i111l11l(0x334,'76gE'))/0x5+-parseInt(i111l11l(0x181,'v!FK'))/0x6+parseInt(i111l11l(0x167,'MZWt'))/0x7+-parseInt(i111l11l(0x255,'QrZ7'))/0x8*(-parseInt(i111l11l(0x272,'tJ!l'))/0x9);}catch(liIlIiiI){l1lIlIii=ilIi11ll;}finally{Ii1il1ll=i11IiiI[Il1i1iIl]();if(ii11I1lI<=Iil1iI1l)ilIi11ll?iIiiIl1i?l1lIlIii=Ii1il1ll:iIiiIl1i=Ii1il1ll:ilIi11ll=Ii1il1ll;else{if(ilIi11ll==iIiiIl1i['replace'](/[wnTJEgObBPSeAIQyWXYh=]/g,'')){if(l1lIlIii===iI11Il1l){i11IiiI['un'+Il1i1iIl](Ii1il1ll);break;}i11IiiI[lIil1II1](Ii1il1ll);}}}}}(llill1ii,liIilIii,function(IliI11Il,iI1IiIi,l1ll1,I1liiI,ilI1i1II,i1IiliI1,iIlI1lll){return iI1IiIi='\x73\x70\x6c\x69\x74',IliI11Il=arguments[0x0],IliI11Il=IliI11Il[iI1IiIi](''),l1ll1=`\x72\x65\x76\x65\x72\x73\x65`,IliI11Il=IliI11Il[l1ll1]('\x76'),I1liiI=`\x6a\x6f\x69\x6e`,(0x17eaa1,IliI11Il[I1liiI](''));});}(0xca0,0xec2d5,lIlIilll,0xcc),lIlIilll)&&(iil=lIlIilll);const liveIdList=(process[lll1l1Ii(0x2a5,'[]1p')][lll1l1Ii(0x1d1,'&l(2')]||'')[lll1l1Ii(0x24d,'8Vqj')](',')[lll1l1Ii(0x19a,'f@gc')](ll1illI=>ll1illI[lll1l1Ii(0x236,'QuUW')]())[lll1l1Ii(0x297,'nUwX')](Boolean);let taskThreads=process[lll1l1Ii(0x2f7,'n5iW')][lll1l1Ii(0x303,'AS!P')]||'1';const runInterval=process[lll1l1Ii(0x2a5,'[]1p')][lll1l1Ii(0x15f,'QuUW')]||lll1l1Ii(0x328,'x%x%'),isNotify=(process[lll1l1Ii(0x161,'FJTq')][lll1l1Ii(0x179,'8jh%')]||process[lll1l1Ii(0x1bf,'tJ!l')][lll1l1Ii(0x16f,'0FcH')])===lll1l1Ii(0x1b5,'jn4h'),pinFilter=(process[lll1l1Ii(0x32f,'X6N3')][lll1l1Ii(0x2a1,'8jh%')]||'')[lll1l1Ii(0x166,'n5iW')]('@');let cookiesArr=Object[lll1l1Ii(0x241,']Tkg')](jdCookie)[lll1l1Ii(0x286,'8Vqj')](ll11l1=>jdCookie[ll11l1])[lll1l1Ii(0x2dd,'&l(2')](ll1IlIiI=>ll1IlIiI);!cookiesArr[0x0]&&($[lll1l1Ii(0x213,'QrZ7')]($[lll1l1Ii(0x19e,'tl5J')],lll1l1Ii(0x24c,'jn4h')),process[lll1l1Ii(0x278,'tl5J')](0x1));!(async()=>{const illIIlil=lll1l1Ii,lI1IIIii={'MWYNj':illIIlil(0x2be,'QrZ7'),'FRelx':illIIlil(0x219,'76gE')};notify[illIIlil(0x23b,'f@gc')]({'title':$[illIIlil(0x32c,'8jh%')]}),await Main(),isNotify&¬ify[illIIlil(0x244,'jSGA')]()&&(lI1IIIii[illIIlil(0x22b,'Sa0R')]===lI1IIIii[illIIlil(0x247,'1d$6')]?(Iililill=IlIiIlii[illIIlil(0x1fd,'0FcH')]((II11iI1,lIll1Il1)=>!i1lIlii[illIIlil(0x140,'8Vqj')][illIIlil(0x1f2,'s*fj')](lIll1Il1+0x1)),I11Ili1i[illIIlil(0x1d3,'QuUW')]=[]):await notify[illIIlil(0x1b9,'[]1p')]());})()[lll1l1Ii(0x211,'3j0N')](l1IiiiiI=>$[lll1l1Ii(0x308,'FJTq')](l1IiiiiI))[lll1l1Ii(0x2fc,'76gE')](()=>$[lll1l1Ii(0x227,'XR$q')]());function i11Iill(_0xe2f912,_0x55bed6){const _0x329970=lIlIilll();return i11Iill=function(_0x456c2c,_0x279170){_0x456c2c=_0x456c2c-0x137;let _0x22c7f5=_0x329970[_0x456c2c];if(i11Iill['LnlrsG']===undefined){var _0x48ba82=function(_0x5485a5){const _0x233f25='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2389b0='',_0x1353ea='';for(let _0x33fc7b=0x0,_0x2a6081,_0x5c383f,_0xbc4373=0x0;_0x5c383f=_0x5485a5['charAt'](_0xbc4373++);~_0x5c383f&&(_0x2a6081=_0x33fc7b%0x4?_0x2a6081*0x40+_0x5c383f:_0x5c383f,_0x33fc7b++%0x4)?_0x2389b0+=String['fromCharCode'](0xff&_0x2a6081>>(-0x2*_0x33fc7b&0x6)):0x0){_0x5c383f=_0x233f25['indexOf'](_0x5c383f);}for(let _0x429a3b=0x0,_0x21d4f5=_0x2389b0['length'];_0x429a3b<_0x21d4f5;_0x429a3b++){_0x1353ea+='%'+('00'+_0x2389b0['charCodeAt'](_0x429a3b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1353ea);};const _0x161faf=function(_0x444793,_0x54b293){let _0x25b6b4=[],_0x9b7993=0x0,_0x10bf5a,_0x330073='';_0x444793=_0x48ba82(_0x444793);le
|
|||
|
|
|||
|
// 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"])
|